Minimalistic Live Testing Fable Apps With QUnit

New to Fable? See the wiki to get started

Setting up QUnit

dotnet new fable

This QUnit.fs binding assumes there is a global QUnit variable.

<ItemGroup>  <Compile Include="path/to/QUnit.fs" />  <Compile Include="src/App.fs" /></ItemGroup>
dotnet fable npm-run start

Testing asynchronous code

See the official docs of QUnit to learn more

let finish = test.asyncMany n
test.equalWithMsg result 16 "square 4 = 16"

Using the QUnit CLI

npm install --save-dev qunitjs
dotnet fable npm-run build
"scripts": {  "build": "webpack -p",  "start": "webpack-dev-server",  "test": "qunit/qunit.js public/bundle.js"}

The End



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store