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

30
test/tap.spec.ts Normal file
View File

@@ -0,0 +1,30 @@
import assert from 'node:assert';
describe('tap', () => {
it('should intercept and return the given value', () => {
let intercepted,
array = [1, 2, 3];
const actual = _.tap(array, (value) => {
intercepted = value;
});
assert.strictEqual(actual, array);
assert.strictEqual(intercepted, array);
});
it('should intercept unwrapped values and return wrapped values when chaining', () => {
let intercepted,
array = [1, 2, 3];
const wrapped = _(array).tap((value) => {
intercepted = value;
value.pop();
});
assert.ok(wrapped instanceof _);
wrapped.value();
assert.strictEqual(intercepted, array);
});
});