Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 654 Bytes

README.md

File metadata and controls

40 lines (30 loc) · 654 Bytes

A minimal testing library for Node.js

Installation

# npm
$ npm install @sunney/testing

# yarn
$ yarn add @sunney/testing

# pnpm
$ pnpm add @sunney/testing

Usage

import { expect, run, test } from "@sunney/testing";

test("math", (it) => {
  it("adds 1 to 1", async () => {
    expect(1 + 1).toBe(2);
  });
});

// synchroneous test
test("do some requests", (it) => {
  const client = new SomeClient();

  it("authenticates", async () => {
    await client.auth();
  });

  it("gets a list of users", async () => {
    const users = await client.getUsers();
    expect(users.length).toBe(3);
  });
}).sync();