Reason Native
  • Docs
  • Help
  • GitHub

›Rely

Overview

  • Introduction
  • Native Basics
  • Getting Started

Rely

  • Introduction
  • Quickstart
  • Guides

    • Setup and Teardown
    • Mock Functions

    API Reference

    • Basic API
    • Expect
  • Advanced

Console

  • Introduction
  • Quickstart
  • API

Pastel

  • Introduction
  • Quickstart
  • API
  • Console

Refmterr

  • Introduction
  • Quickstart

File Context Printer

  • Introduction
  • Quickstart
  • API

Rely Introduction

Rely is a Jest-inspired native Reason testing framework.

We took the things we loved about Jest (beautiful output, descriptive assertion framework, and snapshot testing), added some type safety, and built a library that can compile and run entire test suites both natively and in JS with Js_of_ocaml in milliseconds.

describe("Example", ({test}) => {
  test("ints", ({expect}) =>
    expect.int(1 + 1).toBe(3)
  );
  test("bools", ({expect}) =>
    expect.bool(true).not.toBe(false)
  );
});
Running 1 test suite

 FAIL  Example
  • Example › ints

    expect.int(received).toBe(expected)

    Expected: 3
    Received: 2

       3 ┆ 
       4 ┆ describe("Example", ({test}) => {
       5 ┆   test("ints", ({expect}) => {
       6 ┆     expect.int(1 + 1).toBe(3);
       7 ┆     ();
       8 ┆   });
       9 ┆   test("bools", ({expect}) => {

      Raised by primitive operation at ./tests/ExampleTest.re:6:4
      Called from ./map.ml:291:20
      Called from ./common/CommonCollections.re:171:8


Test Suites: 1 failed, 0 passed, 1 total
Tests:       1 failed, 1 passed, 2 total
Time:        0.002s
← Getting StartedQuickstart →
Reason Native
Projects
RelyConsolePastelRefmterrFile Context Printer
More
GitHubStar
Facebook Open Source
Copyright © 2021 Facebook Inc.