Fable 4 bindings for jest and friends for delightful Fable testing:
A quick look:
Jest.describe("my tests", fun () ->
Jest.test("water is wet", fun () ->
Jest.expect("test").toBe("test")
Jest.expect("test").not.toBe("somethingElse")
Jest.expect("hi").toHaveLength(2)
Jest.expect("hi").not.toHaveLength(3)
)
Jest.test.prop("Is positive", Arbitrary.ConstrainedDefaults.integer(1,100), fun i ->
Jest.expect(i).toBeGreaterThan(0)
)
)This release upgrades all packages to support Fable 4, bringing improved performance and better JavaScript output.
- Fable.Core: 3.x → 4.x
- Fable.Promise: 2.x → 3.x
- Feliz: 1.x → 2.x
When upgrading to v0.34.0, you will need to:
-
Upgrade to Fable 4 - Install Fable 4 as a .NET tool:
dotnet tool install fable --local
-
Update your dependencies - Update your paket.dependencies or package references to use:
Fable.Core >= 4.0.0Fable.Promise >= 3.0.0Feliz >= 2.0.0(if using Fable.ReactTestingLibrary4)- Replace old packages with new ones:
Fable.Jester→Fable.Jester4Fable.FastCheck→Fable.FastCheck4Fable.FastCheck.Jest→Fable.FastCheck4.JestFable.ReactTestingLibrary→Fable.ReactTestingLibrary4
-
Update your code - Update namespace imports in your F# files:
// Old: open Fable.Jester open Fable.FastCheck open Fable.ReactTestingLibrary // New: open Fable.Jester4 open Fable.FastCheck4 open Fable.ReactTestingLibrary4
-
Update build scripts - Replace
fable-splittercommands withdotnet fable:# Old: fable-splitter -c splitter.config.js # New: dotnet fable <project-path> -o <output-dir>
- Added
int64overloads forJest.expectto prevent implicit decimal conversions - Fixed type compatibility issues with Browser.Types in Fable 4
Full documentation can be found here.
