mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
wip: migrate to bun
This commit is contained in:
23
test/without.spec.ts
Normal file
23
test/without.spec.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import assert from 'node:assert';
|
||||
import without from '../src/without';
|
||||
|
||||
describe('without', () => {
|
||||
it('should return the difference of values', () => {
|
||||
const actual = without([2, 1, 2, 3], 1, 2);
|
||||
assert.deepStrictEqual(actual, [3]);
|
||||
});
|
||||
|
||||
it('should use strict equality to determine the values to reject', () => {
|
||||
const object1 = { a: 1 },
|
||||
object2 = { b: 2 },
|
||||
array = [object1, object2];
|
||||
|
||||
assert.deepStrictEqual(without(array, { a: 1 }), array);
|
||||
assert.deepStrictEqual(without(array, object1), [object2]);
|
||||
});
|
||||
|
||||
it('should remove all occurrences of each value from an array', () => {
|
||||
const array = [1, 2, 3, 1, 2, 3];
|
||||
assert.deepStrictEqual(without(array, 1, 2), [3, 3]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user