package melange-fest

All checked builds pass
  1. Overview
  2. Docs
A minimal test framework for Melange

Install

dune-project
 Dependency

Authors

Maintainers

Sources

melange-fest-0.2.0.tbz
sha256=9f578ecb9bc185a5bab983b59ac08aa079bd41058f19d3e902d94fdf552f9c88
sha512=2b59e1e23d4c027df99ebd94eeb9c49d0b5a024f22ebfd01ff19ea9497348c60adaf67f161aaac743ae94d8093240399463a0eb0dffce8351fa75a73d99a9c88

Description

A minimal test framework for Melange using Node test runner

Tags

melange node org:ahrefs

Added to opam-repository:

README

melange-fest

A minimal test framework for Melange using Node test runner.

Quick Start

open Fest

test("1+1=2", () => expect |> equal(1 + 1, 2));

React

React support is provided by reason-react.

open Fest;
module RTL = ReactTestingLibrary;
[@mel.get] external textContent: Dom.element => string = "textContent";

Domloader.init();

module Hello = {
  [@react.component]
  let make = (~text) => <div> {"Hello " ++ text |> React.string} </div>;
};

let () =
  test("test component", () => {
    let result = RTL.render(<Hello text="Nila" />);

    // 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:

make test

Dependencies (3)

  1. melange >= "5.0.0"
  2. dune >= "3.9"
  3. ocaml

Dev Dependencies (7)

  1. ocamlformat with-test
  2. odoc with-doc
  3. ocaml-lsp-server with-test
  4. melange-testing-library with-test
  5. reason-react-ppx with-test
  6. reason-react with-test
  7. reason with-test

Optional Dependencies

None

Conflicts (1)

  1. dune >= "3.25" & < "3.26"

Build status

Results of building melange-fest with each compiler on check.ci.ocaml.org, run of against opam-repository 78c202b. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.2.0 (this version) n/a good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure