Skip to content

Commit

Permalink
Fix failing test due to incorrect API
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark1626 committed Feb 3, 2020
1 parent 00a9506 commit 2134ef4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
16 changes: 13 additions & 3 deletions e2e/__tests__/jasmineAsync.test.ts
Expand Up @@ -117,10 +117,20 @@ describe('async jasmine', () => {

it('works with concurrent.each', () => {
const {json} = runWithJson('jasmine-async', ['concurrent-each.test.js']);
expect(json.numTotalTests).toBe(2);
expect(json.numPassedTests).toBe(1);
expect(json.numTotalTests).toBe(4);
expect(json.numPassedTests).toBe(2);
expect(json.numFailedTests).toBe(0);
expect(json.numPendingTests).toBe(1);
expect(json.numPendingTests).toBe(2);
});

it('works with concurrent.only.each', () => {
const {json} = runWithJson('jasmine-async', [
'concurrent-only-each.test.js',
]);
expect(json.numTotalTests).toBe(4);
expect(json.numPassedTests).toBe(2);
expect(json.numFailedTests).toBe(0);
expect(json.numPendingTests).toBe(2);
});

it("doesn't execute more than 5 tests simultaneously", () => {
Expand Down
27 changes: 11 additions & 16 deletions e2e/jasmine-async/__tests__/concurrent-each.test.js
Expand Up @@ -7,19 +7,14 @@

'use strict';

it.concurrent.each(
[
[1, 2],
[2, 3],
],
'adds one to number',
Promise.resolve()
);
it.concurrent.skip.each(
[
[1, 2],
[2, 3],
],
'should skip this test',
Promise.resolve()
);
it.concurrent.each([
[1, 2],
[2, 3],
])('adds one to number', async (a, b) => {
expect(a + 1).toBe(b);
});

it.concurrent.skip.each([
[1, 2],
[2, 3],
])('should skip this test', Promise.resolve());
22 changes: 22 additions & 0 deletions e2e/jasmine-async/__tests__/concurrent-only-each.test.js
@@ -0,0 +1,22 @@
/**
* 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.
*/

'use strict';

it.concurrent.only.each([
[1, 2],
[2, 3],
])('adds one to number', async (a, b) => {
expect(a + 1).toBe(b);
});

it.concurrent.each([
[1, 2],
[2, 3],
])('adds one to number', async (a, b) => {
expect(a + 1).toBe(b);
});

0 comments on commit 2134ef4

Please sign in to comment.