I'm no expert, but unit testing with Xunit is straightforward if you're just trying to test business logic: it executes in the VS Xunit runner as usual. Then Websharper translates your F# code automatically into JavaScript, and at runtime it is the JavaScript which executes. The obvious limitation there is that you have to write your implementation in the subset of F# which can be translated to JavaScript (e.g. I had to avoid calling System.Random(int), which affected how I wrote my dependency injection). Furthermore, you're trusting WebSharper to do the translation correctly, and so in addition to your unit tests you might want some integration tests which run the actual translated application + JavaScript in a headless client like PhantomJS.

By on 9/12/2015 2:56 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper