Skip to content

test: partially fix broken tests #5733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Sep 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fix ary.spec.js
Signed-off-by: tison <wander4096@gmail.com>
  • Loading branch information
tisonkun committed Sep 21, 2023
commit 30060af2092eba7b905365999065fe9559a254cc
13 changes: 5 additions & 8 deletions test/ary.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import lodashStable from 'lodash';
import lodashStable, { ary, curry, rearg } from 'lodash';
import { slice, _ } from './utils';
import ary from '../src/ary';
import curry from '../src/curry';
import rearg from '../src/rearg';

describe('ary', () => {
function fn(a, b, c) {
Expand All @@ -11,15 +8,15 @@ describe('ary', () => {

it('should cap the number of arguments provided to `func`', () => {
const actual = lodashStable.map(['6', '8', '10'], ary(parseInt, 1));
expect(actual, [6, 8).toEqual(10]);
expect(actual).toEqual([6, 8, 10]);

const capped = ary(fn, 2);
expect(capped('a', 'b', 'c', 'd'), ['a').toEqual('b']);
expect(capped('a', 'b', 'c', 'd')).toEqual(['a', 'b']);
});

it('should use `func.length` if `n` is not given', () => {
const capped = ary(fn);
expect(capped('a', 'b', 'c', 'd'), ['a', 'b').toEqual('c']);
expect(capped('a', 'b', 'c', 'd')).toEqual(['a', 'b', 'c']);
});

it('should treat a negative `n` as `0`', () => {
Expand Down Expand Up @@ -73,7 +70,7 @@ describe('ary', () => {
const funcs = lodashStable.map([fn], ary);
const actual = funcs[0]('a', 'b', 'c');

expect(actual, ['a', 'b').toEqual('c']);
expect(actual).toEqual(['a', 'b', 'c']);
});

it('should work when combined with other methods that use metadata', () => {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy