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

26
test/now.spec.ts Normal file
View File

@@ -0,0 +1,26 @@
import assert from 'node:assert';
import { _, stubA } from './utils';
describe('now', () => {
it('should return the number of milliseconds that have elapsed since the Unix epoch', (done) => {
const stamp = +new Date(),
actual = _.now();
assert.ok(actual >= stamp);
setTimeout(() => {
assert.ok(_.now() > actual);
done();
}, 32);
});
it('should work with mocked `Date.now`', () => {
const now = Date.now;
Date.now = stubA;
const actual = _.now();
Date.now = now;
assert.strictEqual(actual, 'a');
});
});