package melange-fest

  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

Published: 14 Mar 2026

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

Used by

None

Conflicts

None