utils/tests/misc.spec.ts
ztimson 26cc18ffb3
Some checks failed
Build / Build NPM Project (push) Failing after 44s
Build / Publish Documentation (push) Has been skipped
Build / Tag Version (push) Has been skipped
Fixed path event, renamed testCondition to logicTest & fixed some tests
2025-05-11 11:46:03 -04:00

19 lines
478 B
TypeScript

import {fn} from '../src';
describe('Miscellanies Utilities', () => {
describe('fn', () => {
test('async', async () => {
const test = {a: Math.random()};
const resp = fn(test, 'return a;', true);
expect(resp instanceof Promise).toBeTruthy();
expect(await resp).toEqual(test['a']);
});
test('sync', async () => {
const test = {a: Math.random()};
const resp = fn(test, 'return a;3');
expect(resp).toEqual(test['a']);
});
});
});