Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/draftbit/re-jest
Easier bindings to Jest for ReasonML
https://github.com/draftbit/re-jest
Last synced: about 2 months ago
JSON representation
Easier bindings to Jest for ReasonML
- Host: GitHub
- URL: https://github.com/draftbit/re-jest
- Owner: draftbit
- Created: 2020-07-10T18:39:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-17T10:10:41.000Z (3 months ago)
- Last Synced: 2024-10-17T15:19:22.000Z (3 months ago)
- Language: Reason
- Size: 982 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# re-jest
## Jest bindings in ReasonML
This is a set of bindings to `jest` in ReasonML, It aims to be simpler to use than `bs-jest`, with most functions returning `unit`, enabling a developer to write their tests with the same approach they would take writing them in JavaScript, but without needing to leave the type safety of ReasonML.
```reason
describe("myTests", () => {
test("numbers", () => {
let myNumber = 123;
expect(myNumber)->toBeGreaterThan(100);
expect(myNumber)->not->toBeLessThanOrEqual(1);// It also works for floats...
expect(myNumber->float_of_int)->toBeLessThan(124.0);
});testAsync("promises", () => {
expect(Js.Promise.resolve(123))->resolves->toEqual(123);
});test("arrays", () => {
expect([|1, 2, 3, 4, 5|])->toContain(4);
});// Still working on this one...
Skip.test("billion dollar idea generator",
() =>
expect(generateBillionDollarCompany()->valuation)
->toBeGreaterThan(1000000000)
);
});
```## Stability
Very much a work in progress, but nonetheless it can do enough to test plenty of existing code.