Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
77 lines (54 sloc) 1.52 KB
id title sidebar_label
intro
Reason Testing Library
Introduction

Bindings for several testing libraries have been ported to ReasonML.

bs-react-testing-library contains BuckleScript bindings for react-testing-library.

bs-dom-testing-library contains BuckleScript bindings for dom-testing-library.

npm install --save-dev bs-dom-testing-library
npm install --save-dev bs-react-testing-library

Setup

After installation, you will need the packages bsconfig.json file like so:

{
  "bs-dev-dependencies": ["bs-react-testing-library"]
}

or

{
  "bs-dev-dependencies": ["bs-dom-testing-library"]
}

Other Dependencies

bs-platform

This is what BuckleScript uses to compile the Reason code to JS. If it is not in your project you can install it like so:

npm install --save-dev bs-platform

bs-jest

This is the recommended test runner and is a wrapper around Jest. All of the examples here will be using it.

npm install --save-dev @glennsl/bs-jest

Then update bsconfig.json:

{
  "bs-dev-dependencies": ["@glennsl/bs-jest"]
}
You can’t perform that action at this time.