Skip to content

Fable bindings for jest and friends for delightful Fable testing.

License

Notifications You must be signed in to change notification settings

TomOptima/Fable.Jester

 
 

Repository files navigation

Fable.Jester4 Nuget Nuget Nuget Nuget

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)
    )
)

Latest Release (v0.34.0)

🎉 Fable 4 Support

This release upgrades all packages to support Fable 4, bringing improved performance and better JavaScript output.

📦 Updated Dependencies

  • Fable.Core: 3.x → 4.x
  • Fable.Promise: 2.x → 3.x
  • Feliz: 1.x → 2.x

⚠️ Breaking Changes

When upgrading to v0.34.0, you will need to:

  1. Upgrade to Fable 4 - Install Fable 4 as a .NET tool:

    dotnet tool install fable --local
  2. Update your dependencies - Update your paket.dependencies or package references to use:

    • Fable.Core >= 4.0.0
    • Fable.Promise >= 3.0.0
    • Feliz >= 2.0.0 (if using Fable.ReactTestingLibrary4)
    • Replace old packages with new ones:
      • Fable.JesterFable.Jester4
      • Fable.FastCheckFable.FastCheck4
      • Fable.FastCheck.JestFable.FastCheck4.Jest
      • Fable.ReactTestingLibraryFable.ReactTestingLibrary4
  3. 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
  4. Update build scripts - Replace fable-splitter commands with dotnet fable:

    # Old:
    fable-splitter -c splitter.config.js
    
    # New:
    dotnet fable <project-path> -o <output-dir>

🔧 Additional Changes

  • Added int64 overloads for Jest.expect to prevent implicit decimal conversions
  • Fixed type compatibility issues with Browser.Types in Fable 4

Full documentation can be found here.

About

Fable bindings for jest and friends for delightful Fable testing.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • F# 99.7%
  • Other 0.3%