wip: migrate to bun

This commit is contained in:
jdalton
2023-09-16 14:47:50 -07:00
parent 2da024c3b4
commit 97d4a2fe19
1052 changed files with 30244 additions and 26856 deletions

33
test/runInContext.spec.ts Normal file
View File

@@ -0,0 +1,33 @@
import assert from 'node:assert';
import lodashStable from 'lodash';
import runInContext from '../src/runInContext';
import uniqueId from '../src/uniqueId';
describe('runInContext', () => {
it('should not require a fully populated `context` object', () => {
const lodash = runInContext({
setTimeout: function (func) {
func();
},
});
let pass = false;
lodash.delay(() => {
pass = true;
}, 32);
assert.ok(pass);
});
it('should use a zeroed `_.uniqueId` counter', () => {
lodashStable.times(2, uniqueId);
const oldId = Number(uniqueId()),
lodash = runInContext();
assert.ok(uniqueId() > oldId);
const id = lodash.uniqueId();
assert.strictEqual(id, '1');
assert.ok(id < oldId);
});
});