@locustjs/test

1.1.7 • Public • Published

About

This library provides a simple test runner.

Install

npm i @locustjs/test

Matchers

  • toBe()
  • notToBe()
  • toBeGt()
  • toBeGte()
  • toBeLt()
  • toBeLte()
  • toBeDefined()
  • toBeUndefined()
  • toBeNull()
  • notToBeNull()
  • toBeNullOrUndefined()
  • notToBeNullOrUndefined()
  • toThrow()
  • toThrowAsync()
  • notToThrow()
  • notToThrowAsync()
  • toBeTruthy()
  • toBeFalsy()
  • toBeNaN()
  • notToBeNaN()

Example:

import TestRunner from '@locustjs/test';

const tests = [
  ['test 1', expect => expect(2 + 2).toBe(4)],
  ['test 2', expect => expect(undefined).toBeUndefined()],
  ['test 3', expect => expect(5).toBeGt(10)],  // this test fails
];

const runner = new TestRunner();

await runner.run(tests);

runner.report();
runner.log();

Readme

Keywords

Package Sidebar

Install

npm i @locustjs/test

Weekly Downloads

1

Version

1.1.7

License

MIT

Unpacked Size

35.9 kB

Total Files

5

Last publish

Collaborators

  • mansoor-omrani