# @greenlabs/rescript-jest

> ReScript bindings for Jest

Latest version **28.1.0** (published 2024-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @greenlabs/rescript-jest
pnpm add @greenlabs/rescript-jest
yarn add @greenlabs/rescript-jest
bun add @greenlabs/rescript-jest
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 28.1.0 |
| Published | 2024-01-02 |
| First published | 2022-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Greenlabs Dev |
| Maintainers | minukang, gyeop, miryangjung, jaeholee.gl, namenu, moondaddi, yousleepwhen, kimchhickey |
| Keywords | rescript, jest |

## Links

- npm: https://www.npmjs.com/package/@greenlabs/rescript-jest
- Repository: https://github.com/green-labs/rescript-bindings
- Homepage: https://github.com/green-labs/rescript-bindings#readme
- Issues: https://github.com/green-labs/rescript-bindings/issues
- npm.io page: https://npm.io/package/@greenlabs/rescript-jest

## Recent versions

- 28.1.0 (latest) — 2024-01-02
- 1.0.1 — 2022-11-21
- 1.0.0 — 2022-10-10
- 0.2.0 — 2022-09-29
- 0.1.1 — 2022-09-20
- 0.1.0 — 2022-09-19

## README

# `rescript-jest`

## Install

```bash
npm i @greenlabs/rescript-jest --dev
or
yarn add @greenlabs/rescript-jest --dev
```

```json
"bs-dev-dependencies": [
  "@greenlabs/rescript-jest"
]
```

## Usage

```rescript
open Jest
open Expect

describe("Test my module", () => {
  let myMockFunction = JestJs.make2((msg, msg2) => msg ++ msg2)
  let setup = () => {
    (myMockFunction->Mock.fn)("Hello ", "world!")
  }
  describe("When call setup", () => {
    beforeEach(() => {
      setup()
    })

    afterEach(() => {
      myMockFunction->Mock.mockClear
    })

    test("myFunction is should called", () => {
      expect(myMockFunction)->toBeCalled()
      expect(myMockFunction)->toBeCalledTimes(1)
    })

    test("myFunction is should called with 'Hello ', 'world!'", () => {
      expect(myMockFunction)->toBeCalledWith(("Hello ", "world!"))
    })

    test("myFunction return is 'Hello world!'", () => {
      expect(myMockFunction)->toReturnedWith("Hello world!")
    })
  })
  
})
```

---
_Source: https://npm.io/package/@greenlabs/rescript-jest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
