Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahrefs/melange-fest
A minimal test framework for Melange using Node test runner
https://github.com/ahrefs/melange-fest
Last synced: 18 days ago
JSON representation
A minimal test framework for Melange using Node test runner
- Host: GitHub
- URL: https://github.com/ahrefs/melange-fest
- Owner: ahrefs
- License: mit
- Created: 2023-11-08T08:00:05.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-02T01:39:08.000Z (about 1 month ago)
- Last Synced: 2024-12-16T19:17:40.932Z (24 days ago)
- Language: OCaml
- Homepage: https://ahrefs.github.io/melange-fest/
- Size: 659 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# melange-fest
A minimal test framework for Melange using [Node test
runner](https://nodejs.org/api/test.html).## Quick Start
```reason
open Festtest("1+1=2", () => expect |> equal(1 + 1, 2));
```### React
React support is provided by
[`reason-react`](https://github.com/reasonml/reason-react/).```reason
open Fest;
module RTL = ReactTestingLibrary;
[@mel.get] external textContent: Dom.element => string = "textContent";Domloader.init();
module Hello = {
[@react.component]
let make = (~text) =>{"Hello " ++ text |> React.string};
};let () =
test("test component", () => {
let result = RTL.render();// Check that Hello component renders the name properly.
let el = RTL.getByText(~matcher=`Str("Hello Nila"), result);
expect |> equal(textContent(el), "Hello Nila");
});
```## Commands
Run all tests:
```bash
make test
```