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

Advanced Topics - Rely

Running with Custom Run Config

let sampleRunConfig = Rely.RunConfig.initialize()
TestFramework.run(sampleRunConfig);

Running with Custom Reporters

let myReporter: Rely.Reporter.t = {
  onTestSuiteStart: (testSuite) => {...},
  onTestSuiteResult: (testSuite, aggregatedResult, testSuiteResult) => {...},
  onRunStart: (relyRunInfo) => {...},
  onRunComplete: (aggregatedResult) => {...}
};

let customReporterConfig = Rely.RunConfig.initialize() |> withReporters([
  Custom(myReporter),
  /* not required, but the default terminal reporter can also be included */
  Default
]);

TestFramework.run(customReporterConfig);

Running in continuous integration environments

It is recommended to use something like the following run configuration in CI

TestFramework.run(
  Rely.RunConfig.(
    initialize()
    /* causes tests to fail if testOnly or describeOnly are used to prevent
     * accidentally disabling all other tests (as of Rely 2.1.0) */
    |> ciMode(true)
    |> withReporters([
         /* the Default reporter prints terminal output, the jUnit reporter
          * outputs junit xml to the provided filepath, most CI solutions have
          * integration with the junit xml format */
         Default,
         JUnit("./junit.xml"),
       ])
  ),
);
← ExpectIntroduction →
  • Running with Custom Run Config
  • Running with Custom Reporters
  • Running in continuous integration environments
Reason Native
Projects
RelyConsolePastelRefmterrFile Context Printer
More
GitHubStar
Facebook Open Source
Copyright © 2021 Facebook Inc.