1.1.0 ā¢ Published 2 years ago
estuaire v1.1.0
estuaire
ā” super fast javascript testing tool ā”
š¦ repository š documents
Features
- ā” lightning fast
- šØ extensible expect
- š¦ typescript supported
- š ļø not required config
Usage
yarn add -D estuaire
"scripts": {
+ "test": "estuaire"
}
// test/index.test.ts
import { expect, describe } from 'estuaire';
describe('sum', () => {
expect(1 + 2).toBe(3);
});
Matcher
const nullValue = null;
const undefinedValue = undefined;
const array = ['ping', 'pong'];
const string = 'hello world';
const number = 2 + 2;
// matchers
expect('hello').toBe('hello');
expect({ a: 10 }).toEqual({ a: 10 });
// truthiness
expect(nullValue).not.toBeDefined();
expect(nullValue).toBeNull();
expect(nullValue).not.toBeUndefined();
expect(undefinedValue).not.toBeDefined();
expect(undefinedValue).toBeUndefined();
// string
expect(string).toContain('hello');
expect(string).toIncludes('hello');
// array
expect(array).toIncludes('ping');
expect(array).toContain('ping');
// number
expect(number).toBeGreaterThan(3);
expect(number).toBeGreaterThanOrEqual(4);
expect(number).toBeLessThan(5);
expect(number).toBeLessThanOrEqual(4);
License
MIT