smartobject/test/test.both.ts

18 lines
587 B
TypeScript
Raw Normal View History

2020-07-24 11:37:11 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartobject from '../ts/index';
tap.test('first test', async () => {
const result = smartobject.compareObjects(
{ thisIsEq: 'wow', thisIsDeepEq: { deeper: 'sodeep' } },
2021-03-22 02:33:23 +00:00
{ thisIsEq: 'wow', thisIsDeepEq: { deeper: 'sodeep' }, hey: 'there' }
2020-07-24 11:37:11 +00:00
);
console.log(result);
});
2021-03-22 02:33:01 +00:00
tap.test('should fast deep equal objects', async () => {
2021-03-22 02:33:23 +00:00
expect(smartobject.fastDeepEqual({ hello: 'yes' }, { hello: 'yes' })).to.be.true;
expect(smartobject.fastDeepEqual({ hello: 'yes' }, { hello: 3 })).to.be.false;
2021-03-22 02:33:01 +00:00
});
2020-07-24 11:37:11 +00:00
tap.start();