test: partially fix broken tests (#5733)

* test: fix throttle.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix pickBy.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix isBuffer.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: partially fix attempt.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: partially fix dropRightWhile.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix defer.spec.js and rest.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix invoke.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix isArray.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: partially fix iteration-methods.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix xor-methods.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix property.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix ary.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix omit-methods.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix debounce-and-throttle.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix unzip-and-zip.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix toPairs-methods.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix exit-early.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: temporarily comment out takeWhile and dropWhile tests

Signed-off-by: tison <wander4096@gmail.com>

* test: partially fix union*.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix startsWith-and-endsWith.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix isNil.spec.js

Signed-off-by: tison <wander4096@gmail.com>

* test: fix some of syntax errors

Signed-off-by: tison <wander4096@gmail.com>

---------

Signed-off-by: tison <wander4096@gmail.com>
This commit is contained in:
tison
2023-09-21 22:40:27 +08:00
committed by GitHub
parent 49683ffd5d
commit bd518dd906
52 changed files with 319 additions and 324 deletions

View File

@@ -8,12 +8,12 @@ describe('rest', () => {
it('should apply a rest parameter to `func`', () => {
const rest = _.rest(fn);
expect(rest(1, 2, 3, 4), [1, 2, [3).toEqual(4]]);
expect(rest(1, 2, 3, 4)).toEqual([1, 2, [3, 4]]);
});
it('should work with `start`', () => {
const rest = _.rest(fn, 1);
expect(rest(1, 2, 3, 4), [1, [2, 3).toEqual(4]]);
expect(rest(1, 2, 3, 4)).toEqual([1, [2, 3, 4]]);
});
it('should treat `start` as `0` for `NaN` or negative values', () => {
@@ -30,12 +30,12 @@ describe('rest', () => {
it('should coerce `start` to an integer', () => {
const rest = _.rest(fn, 1.6);
expect(rest(1, 2, 3), [1, [2).toEqual(3]]);
expect(rest(1, 2, 3)).toEqual([1, [2, 3]]);
});
it('should use an empty array when `start` is not reached', () => {
const rest = _.rest(fn);
expect(rest(1), [1, undefined).toEqual([]]);
expect(rest(1)).toEqual([1, undefined, []]);
});
it('should work on functions with more than three parameters', () => {
@@ -43,6 +43,6 @@ describe('rest', () => {
return slice.call(arguments);
});
expect(rest(1, 2, 3, 4, 5), [1, 2, 3, [4).toEqual(5]]);
expect(rest(1, 2, 3, 4, 5)).toEqual([1, 2, 3, [4, 5]]);
});
});