Skip to content

Commit

Permalink
Support each concurrent in jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark1626 committed Dec 18, 2019
1 parent 9c203c2 commit 9d2077a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
17 changes: 17 additions & 0 deletions packages/jest-jasmine2/src/__tests__/concurrent.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. 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('concurrent', () => {
test.each.concurrent([
[1, 2],
[2, 3],
[3, 4],
])('should add 1 to number', async (a, sum) => {
expect(a + 1).toEqual(sum);
});
});
5 changes: 4 additions & 1 deletion packages/jest-jasmine2/src/each.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
*/

import {JestEnvironment} from '@jest/environment';
import {bind as bindEach} from 'jest-each';
import {bindConcurrent, bind as bindEach} from 'jest-each';

export default (environment: JestEnvironment): void => {
environment.global.it.each = bindEach(environment.global.it);
environment.global.fit.each = bindEach(environment.global.fit);
environment.global.xit.each = bindEach(environment.global.xit);
environment.global.it.each.concurrent = bindConcurrent(
environment.global.it.concurrent,
);
environment.global.describe.each = bindEach(
environment.global.describe,
false,
Expand Down

0 comments on commit 9d2077a

Please sign in to comment.