@sword-health/ui-http-mapper
Version:
UI clients tool for consumption of easy to read/config endpoint maps
34 lines (25 loc) • 883 B
JavaScript
import functions from '../src/functions';
test('Adds 2 + 2 to equal 4', () => {
expect(functions.add(2,2)).toBe(4);
});
test(' 2 + 2 NOT equal 5', () => {
expect(functions.add(2,2)).not.toBe(5);
});
test('Should be null despite params', () => {
expect(functions.isNullWithParam(2,2)).toBeNull();
});
test('Should be null', () => {
expect(functions.isNull(2,2)).toBeNull();
});
test('Should be falsy', () => {
expect(functions.checkValue('')).toBeFalsy();
});
test('Should NOT be falsy', () => {
expect(functions.checkValue(2)).not.toBeFalsy();
});
test('New user was created with defaults', () => {
expect(functions.createNewBro()).toStrictEqual( { firstName: 'Sérgio', lastName: 'Marques' });
});
test('New user was created according to params', () => {
expect(functions.createNewBro('Boda')).toStrictEqual( { firstName: 'Boda', lastName: 'Marques' });
});