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

View File

@@ -0,0 +1,39 @@
import assert from 'node:assert';
import lodashStable from 'lodash';
import { empties, stubTrue, isNpm, lodashBizarro } from './utils';
describe('lodash constructor', () => {
const values = empties.concat(true, 1, 'a'),
expected = lodashStable.map(values, stubTrue);
it('should create a new instance when called without the `new` operator', () => {
const actual = lodashStable.map(values, (value) => _(value) instanceof _);
assert.deepEqual(actual, expected);
});
it('should return the given `lodash` instances', () => {
const actual = lodashStable.map(values, (value) => {
const wrapped = _(value);
return _(wrapped) === wrapped;
});
assert.deepEqual(actual, expected);
});
it('should convert foreign wrapped values to `lodash` instances', () => {
if (!isNpm && lodashBizarro) {
const actual = lodashStable.map(values, (value) => {
const wrapped = _(lodashBizarro(value)),
unwrapped = wrapped.value();
return (
wrapped instanceof _ &&
(unwrapped === value || (unwrapped !== unwrapped && value !== value))
);
});
assert.deepStrictEqual(actual, expected);
}
});
});