Navigation Menu

Skip to content

Commit

Permalink
Update JSON to match new error output
Browse files Browse the repository at this point in the history
unexpected now includes the code from the failing line
  • Loading branch information
bruderstein committed Jun 24, 2018
1 parent fcf5ef3 commit 9ada2cf
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 7 deletions.
Expand Up @@ -8,6 +8,7 @@
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 1,
"numTotalTests": 4,
"openHandles": [],
"snapshot": {
"added": 0,
"didUpdate": false,
Expand All @@ -19,6 +20,7 @@
"matched": 4,
"total": 5,
"unchecked": 0,
"uncheckedKeysByFile": [],
"unmatched": 1,
"updated": 0
},
Expand All @@ -27,29 +29,49 @@
{
"assertionResults": [
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter counts a single click",
"location": null,
"status": "passed",
"title": "counts a single click"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [
"UnexpectedError: \nexpected\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n</button>\nwith event click with event click 'with event click' with event click 'to match snapshot'\n\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n</button>\n"
],
"fullName": "ClickCounter counts multiple clicks",
"location": null,
"status": "failed",
"title": "counts multiple clicks"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter passes multiple snapshots in a single test",
"location": null,
"status": "passed",
"title": "passes multiple snapshots in a single test"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter renders with default props",
"location": null,
"status": "passed",
"title": "renders with default props"
}
],
"message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n </button>\n with event click with event click 'with event click' with event click 'to match snapshot'\n \n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n </button>\n",
"message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n </button>\n with event click with event click 'with event click' with event click 'to match snapshot'\n\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n </button>\n\n 24 | it('counts multiple clicks', function () {\n 25 | const renderer = TestRenderer.create(<ClickCounter />);\n > 26 | expect(renderer,\n | ^\n 27 | 'with event click',\n 28 | 'with event click',\n 29 | 'with event click',\n",
"name": "/src/__tests__/ClickCounter.spec.js",
"status": "failed",
"summary": ""
Expand Down
Expand Up @@ -8,6 +8,7 @@
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 1,
"numTotalTests": 1,
"openHandles": [],
"snapshot": {
"added": 0,
"didUpdate": false,
Expand All @@ -19,6 +20,7 @@
"matched": 0,
"total": 1,
"unchecked": 0,
"uncheckedKeysByFile": [],
"unmatched": 1,
"updated": 0
},
Expand All @@ -27,14 +29,19 @@
{
"assertionResults": [
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [
"UnexpectedError: \nexpected <button .../> to match snapshot\n\n<button className=\"foo bar\"\n onClick={function onClick() { /* ... */ }} // expected\n // function onClick()\n //\n // {\n // this.setState({\n // count: this.state.count + 1 });\n //\n // }\n // to satisfy function bound onClick() { /* function body */ }\n //\n // -function onClick() { /* function body */ }\n // +function bound onClick() { /* function body */ }\n>\n Clicked 0 times\n</button>\n"
"UnexpectedError: \nexpected <button .../> to match snapshot\n\n<button className=\"foo bar\"\n onClick={function onClick() { /* ... */ }} // expected\n // function onClick() {\n // this.setState({\n // count: this.state.count + 1\n // });\n // }\n // to satisfy function bound onClick() { /* function body */ }\n //\n // -function onClick() { /* function body */ }\n // +function bound onClick() { /* function body */ }\n>\n Clicked 0 times\n</button>\n"
],
"fullName": "ClickCounter renders with default props",
"location": null,
"status": "failed",
"title": "renders with default props"
}
],
"message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected <button .../> to match snapshot\n \n <button className=\"foo bar\"\n onClick={function onClick() { /* ... */ }} // expected\n // function onClick()\n //\n // {\n // this.setState({\n // count: this.state.count + 1 });\n //\n // }\n // to satisfy function bound onClick() { /* function body */ }\n //\n // -function onClick() { /* function body */ }\n // +function bound onClick() { /* function body */ }\n >\n Clicked 0 times\n </button>\n",
"message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected <button .../> to match snapshot\n\n <button className=\"foo bar\"\n onClick={function onClick() { /* ... */ }} // expected\n // function onClick() {\n // this.setState({\n // count: this.state.count + 1\n // });\n // }\n // to satisfy function bound onClick() { /* function body */ }\n //\n // -function onClick() { /* function body */ }\n // +function bound onClick() { /* function body */ }\n >\n Clicked 0 times\n </button>\n\n 14 | \n 15 | const renderer = TestRenderer.create(<ClickCounter />);\n > 16 | expect(renderer, 'to match snapshot');\n | ^\n 17 | });\n 18 | \n 19 | // We've removed all other tests, as the onClick won't work without the binding\n",
"name": "/src/__tests__/ClickCounter.spec.js",
"status": "failed",
"summary": ""
Expand Down
Expand Up @@ -8,6 +8,7 @@
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 1,
"numTotalTests": 1,
"openHandles": [],
"snapshot": {
"added": 0,
"didUpdate": false,
Expand All @@ -19,6 +20,7 @@
"matched": 0,
"total": 1,
"unchecked": 0,
"uncheckedKeysByFile": [],
"unmatched": 1,
"updated": 0
},
Expand All @@ -34,11 +36,12 @@
"UnexpectedError: \nexpected <button .../> to match snapshot\n\n<button className=\"foo bar\"\n onClick={function bound onClick() { /* native code */ }} // expected function bound onClick() { /* native code */ }\n // to satisfy function onClick() { /* function body */ }\n //\n // -function bound onClick() { /* function body */ }\n // +function onClick() { /* function body */ }\n>\n Clicked 0 times\n</button>\n"
],
"fullName": "ClickCounter renders with default props",
"location": null,
"status": "failed",
"title": "renders with default props"
}
],
"message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected <button .../> to match snapshot\n \n <button className=\"foo bar\"\n onClick={function bound onClick() { /* native code */ }} // expected function bound onClick() { /* native code */ }\n // to satisfy function onClick() { /* function body */ }\n //\n // -function bound onClick() { /* function body */ }\n // +function onClick() { /* function body */ }\n >\n Clicked 0 times\n </button>\n",
"message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected <button .../> to match snapshot\n\n <button className=\"foo bar\"\n onClick={function bound onClick() { /* native code */ }} // expected function bound onClick() { /* native code */ }\n // to satisfy function onClick() { /* function body */ }\n //\n // -function bound onClick() { /* function body */ }\n // +function onClick() { /* function body */ }\n >\n Clicked 0 times\n </button>\n\n 14 | \n 15 | const renderer = TestRenderer.create(<ClickCounter />);\n > 16 | expect(renderer, 'to match snapshot');\n | ^\n 17 | });\n 18 | \n 19 | // We've removed all other tests, as the onClick won't work without the binding\n",
"name": "/src/__tests__/ClickCounter.spec.js",
"status": "failed",
"summary": ""
Expand Down
Expand Up @@ -8,6 +8,7 @@
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 2,
"numTotalTests": 5,
"openHandles": [],
"snapshot": {
"added": 0,
"didUpdate": false,
Expand All @@ -19,6 +20,7 @@
"matched": 4,
"total": 6,
"unchecked": 0,
"uncheckedKeysByFile": [],
"unmatched": 2,
"updated": 0
},
Expand All @@ -27,44 +29,69 @@
{
"assertionResults": [
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [
"UnexpectedError: \nexpected\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times\n</button>\nwith event click with event click 'with event click' to match snapshot\n\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times // -Clicked 3 times\n // +Clicked 2 times\n</button>\n"
],
"fullName": "ClickCounter counts a single click",
"location": null,
"status": "failed",
"title": "counts a single click"
}
],
"message": " ● ClickCounter › counts a single click\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times\n </button>\n with event click with event click 'with event click' to match snapshot\n \n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times // -Clicked 3 times\n // +Clicked 2 times\n </button>\n",
"message": " ● ClickCounter › counts a single click\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times\n </button>\n with event click with event click 'with event click' to match snapshot\n\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 3 times // -Clicked 3 times\n // +Clicked 2 times\n </button>\n\n 15 | // Changing the output for this test as well, then we have two changes in two separate test files\n 16 | const renderer = TestRenderer.create(<ClickCounter />);\n > 17 | expect(renderer, \n | ^\n 18 | 'with event click',\n 19 | 'with event click',\n 20 | 'with event click',\n",
"name": "/src/__tests__/ClickCounter-other.spec.js",
"status": "failed",
"summary": ""
},
{
"assertionResults": [
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter counts a single click",
"location": null,
"status": "passed",
"title": "counts a single click"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [
"UnexpectedError: \nexpected\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n</button>\nwith event click with event click 'with event click' with event click 'to match snapshot'\n\n<button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n</button>\n"
],
"fullName": "ClickCounter counts multiple clicks",
"location": null,
"status": "failed",
"title": "counts multiple clicks"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter passes multiple snapshots in a single test",
"location": null,
"status": "passed",
"title": "passes multiple snapshots in a single test"
},
{
"ancestorTitles": [
"ClickCounter"
],
"failureMessages": [],
"fullName": "ClickCounter renders with default props",
"location": null,
"status": "passed",
"title": "renders with default props"
}
],
"message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n </button>\n with event click with event click 'with event click' with event click 'to match snapshot'\n \n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n </button>\n",
"message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times\n </button>\n with event click with event click 'with event click' with event click 'to match snapshot'\n\n <button className=\"foo bar\" onClick={function bound onClick() { /* native code */ }}>\n Clicked 4 times // -Clicked 4 times\n // +Clicked 3 times\n </button>\n\n 24 | it('counts multiple clicks', function () {\n 25 | const renderer = TestRenderer.create(<ClickCounter />);\n > 26 | expect(renderer,\n | ^\n 27 | 'with event click',\n 28 | 'with event click',\n 29 | 'with event click',\n",
"name": "/src/__tests__/ClickCounter.spec.js",
"status": "failed",
"summary": ""
Expand Down

0 comments on commit 9ada2cf

Please sign in to comment.