Skip to content
Merged
Show file tree
Hide file tree
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
Add 1d e2e tests
  • Loading branch information
mattphillips committed May 29, 2018
commit 0f428a7f50e6620c0181036e2d0b847045732968
56 changes: 55 additions & 1 deletion e2e/__tests__/__snapshots__/each.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports[`shows error message when not enough arguments are supplied to tests 1`]

Missing 1 arguments

at packages/jest-each/build/bind.js:81:17
at packages/jest-each/build/bind.js:84:17

"
`;
Expand Down Expand Up @@ -68,6 +68,9 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `
✓ template table fails on one row expected: true == true
✕ template table fails on all rows expected: 1 == 2
✕ template table fails on all rows expected: 3 == 4
✕ The word red contains the letter 'z'
✕ The word green contains the letter 'z'
✕ The word bean contains the letter 'z'
template table describe fails on all rows expected a == b
✕ fails
template table describe fails on all rows expected c == d
Expand Down Expand Up @@ -247,5 +250,56 @@ exports[`shows the correct errors in stderr when failing tests 1`] = `

at __tests__/failure.test.js:61:20

● The word red contains the letter 'z'

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

67 | \\"The word %s contains the letter 'z'\\",
68 | word => {
> 69 | expect(/z/.test(word)).toBe(true);
| ^
70 | }
71 | );
72 |

at __tests__/failure.test.js:69:28

● The word green contains the letter 'z'

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

67 | \\"The word %s contains the letter 'z'\\",
68 | word => {
> 69 | expect(/z/.test(word)).toBe(true);
| ^
70 | }
71 | );
72 |

at __tests__/failure.test.js:69:28

● The word bean contains the letter 'z'

expect(received).toBe(expected) // Object.is equality

Expected: true
Received: false

67 | \\"The word %s contains the letter 'z'\\",
68 | word => {
> 69 | expect(/z/.test(word)).toBe(true);
| ^
70 | }
71 | );
72 |

at __tests__/failure.test.js:69:28

"
`;
7 changes: 7 additions & 0 deletions e2e/each/__tests__/failure.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ describe.each([['a', 'b'], ['c', 'd']])(
});
}
);

test.each(['red', 'green', 'bean'])(
"The word %s contains the letter 'z'",
word => {
expect(/z/.test(word)).toBe(true);
}
);
7 changes: 7 additions & 0 deletions e2e/each/__tests__/success.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
* LICENSE file in the root directory of this source tree.
*/

test.each(['red', 'green', 'bean'])(
"The word %s contains the letter 'e'",
word => {
expect(/e/.test(word)).toBe(true);
}
);

it.each([[true, true], [true, true]])(
'passes one row expected %s == %s',
(left, right) => {
Expand Down