-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Snapshot methods to parse and getContent separately (#94)
- Loading branch information
1 parent
6eed147
commit 710fd66
Showing
7 changed files
with
184 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/__tests__/fixtures/snapshots/__snapshots__/inline-and-each.example.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
exports[`test.each a 1`] = `a`; | ||
exports[`test.each b 1`] = `b`; | ||
exports[`test.each c 1`] = `c`; | ||
exports[`1 describe with each test.each a 1`] = `1.a`; | ||
exports[`1 describe with each test.each b 1`] = `1.b`; | ||
exports[`1 describe with each test.each c 1`] = `1.c`; | ||
exports[`2 describe with each test.each a 1`] = `2.a`; | ||
exports[`2 describe with each test.each b 1`] = `2.b`; | ||
exports[`2 describe with each test.each c 1`] = `2.c`; | ||
exports[`3 describe with each test.each a 1`] = `3.a`; | ||
exports[`3 describe with each test.each b 1`] = `3.b`; | ||
exports[`3 describe with each test.each c 1`] = `3.c`; | ||
exports[`tests with each case 1 test 1-D array each 1`] = `1 1-D`; | ||
exports[`tests with each case 2 test 1-D array each 1`] = `2 1-D`; | ||
exports[`tests with each case 3 test 1-D array each 1`] = `3 1-D`; | ||
exports[`literal test 1`] = `literal test 1 content`; | ||
exports[`literal test 2`] = `literal test 2 content`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
describe('tests with each', () => { | ||
it.each` | ||
case|whatever | ||
${1}|${'a'} | ||
$(2)|${'b'} | ||
`('case $case: test tabled each', ({whatever}) => { | ||
expect(whatever).toMatchSnapshot(); | ||
expect(whatever).toMatchInlineSnapshot(); | ||
}); | ||
it.each([1,2,3])('case %d test 1-D array each', (n) => { | ||
expect(n).toThrowErrorMatchingSnapshot(); | ||
expect(n).toMatchInlineSnapshot(); | ||
|
||
}); | ||
}); | ||
|
||
describe.each([1,2,3])('%d describe with each', (n) => { | ||
it.each(['a', 'b', 'c'])('test.each %s', (char) => { | ||
expect({n, char}).toMatchSnapshot(); | ||
}); | ||
it('a regular test', () => { | ||
expect(n).toMatchInlineSnapshot(); | ||
}); | ||
}); | ||
|
||
it.each(['a', 'b', 'c'])('inline test.each %s', (char) => { | ||
expect(char).toThrowErrorMatchingInlineSnapshot(); | ||
}); | ||
it.each(['a', 'b', 'c'])('test.each %s', (char) => { | ||
expect(char).toMatchSnapshot(); | ||
}); | ||
it('regular inline test', () => { | ||
expect(whatever).toMatchInlineSnapshot(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters