wip: code formatting nits continued

This commit is contained in:
jdalton
2023-09-16 22:59:56 -07:00
parent 0b28b7f7b6
commit b5c59317ea
421 changed files with 7354 additions and 9005 deletions

28
test/tap.spec.js Normal file
View File

@@ -0,0 +1,28 @@
describe('tap', () => {
it('should intercept and return the given value', () => {
let intercepted;
const array = [1, 2, 3];
const actual = _.tap(array, (value) => {
intercepted = value;
});
expect(actual).toBe(array);
expect(intercepted).toBe(array);
});
it('should intercept unwrapped values and return wrapped values when chaining', () => {
let intercepted;
const array = [1, 2, 3];
const wrapped = _(array).tap((value) => {
intercepted = value;
value.pop();
});
expect(wrapped instanceof _);
wrapped.value();
expect(intercepted).toBe(array);
});
});