-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add each to jest-cirucs #6309
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
Add each to jest-cirucs #6309
Changes from 5 commits
17546bf
fe973ab
3bb5231
3d5e4ca
eb43bb3
6bbd790
c773fe1
464ce7d
ace0d06
2883ba0
4861776
4d21e8b
c4fcf55
1a0213d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| /** | ||
| * Copyright (c) 2018-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| describe.only.each([[true, true], [true, true]])( | ||
| 'passes all rows expected %s == %s', | ||
| (left, right) => { | ||
| it('passes', () => { | ||
| expect(left).toBe(right); | ||
| }); | ||
| } | ||
| ); | ||
|
|
||
| // This failing tests should never because of the above `only` so the suite | ||
| // should pass | ||
| describe.each([[false, true]])( | ||
| 'fails all rows expected %s == %s', | ||
| (left, right) => { | ||
| it('fails', () => { | ||
| expect(left).toBe(right); | ||
| }); | ||
| } | ||
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,25 @@ | ||
| /** | ||
| * Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * @flow | ||
| */ | ||
|
|
||
| import bind from './bind'; | ||
| import arrayEach from './array'; | ||
| import templateEach from './template'; | ||
|
|
||
| const each = (...args) => { | ||
| const each = (...args: any) => { | ||
|
||
| if (args.length > 1) { | ||
| return templateEach(global)(...args); | ||
| } | ||
|
|
||
| return arrayEach(global)(...args); | ||
| }; | ||
|
|
||
| each.withGlobal = g => (...args) => { | ||
| each.withGlobal = g => (...args: any) => { | ||
| if (args.length > 1) { | ||
| return templateEach(g)(...args); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, do we need skipping it on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we tried removing this before and it failed 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #6102 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably add a helper fixing the differing symbols on windows and unix so that the integration tests can run. separate issue, though