From 9ada2cfdb69d39b24a55d247b5661486ff0347d3 Mon Sep 17 00:00:00 2001 From: Dave Brotherstone Date: Sun, 24 Jun 2018 13:43:18 +0200 Subject: [PATCH] Update JSON to match new error output unexpected now includes the code from the failing line --- .../3-change-in-code/expectedOutput.json | 24 +++++++++++++- .../expectedOutput.json | 11 +++++-- .../4-add-binding-back/expectedOutput.json | 5 ++- .../3-change-in-code/expectedOutput.json | 31 +++++++++++++++++-- .../1-failures/expectedOutput.json | 24 +++++++++++++- 5 files changed, 88 insertions(+), 7 deletions(-) diff --git a/jest-integration/tests/basics/3-change-in-code/expectedOutput.json b/jest-integration/tests/basics/3-change-in-code/expectedOutput.json index b869768..3e02b15 100644 --- a/jest-integration/tests/basics/3-change-in-code/expectedOutput.json +++ b/jest-integration/tests/basics/3-change-in-code/expectedOutput.json @@ -8,6 +8,7 @@ "numRuntimeErrorTestSuites": 0, "numTotalTestSuites": 1, "numTotalTests": 4, + "openHandles": [], "snapshot": { "added": 0, "didUpdate": false, @@ -19,6 +20,7 @@ "matched": 4, "total": 5, "unchecked": 0, + "uncheckedKeysByFile": [], "unmatched": 1, "updated": 0 }, @@ -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\nwith event click with event click 'with event click' with event click 'to match snapshot'\n\n\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 \n with event click with event click 'with event click' with event click 'to match snapshot'\n \n \n", + "message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n \n with event click with event click 'with event click' with event click 'to match snapshot'\n\n \n\n 24 | it('counts multiple clicks', function () {\n 25 | const renderer = TestRenderer.create();\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": "" diff --git a/jest-integration/tests/functions/2-remove-event-binding/expectedOutput.json b/jest-integration/tests/functions/2-remove-event-binding/expectedOutput.json index b226a86..2669e83 100644 --- a/jest-integration/tests/functions/2-remove-event-binding/expectedOutput.json +++ b/jest-integration/tests/functions/2-remove-event-binding/expectedOutput.json @@ -8,6 +8,7 @@ "numRuntimeErrorTestSuites": 0, "numTotalTestSuites": 1, "numTotalTests": 1, + "openHandles": [], "snapshot": { "added": 0, "didUpdate": false, @@ -19,6 +20,7 @@ "matched": 0, "total": 1, "unchecked": 0, + "uncheckedKeysByFile": [], "unmatched": 1, "updated": 0 }, @@ -27,14 +29,19 @@ { "assertionResults": [ { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ - "UnexpectedError: \nexpected \n" + "UnexpectedError: \nexpected \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 \n", + "message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected \n\n 14 | \n 15 | const renderer = TestRenderer.create();\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": "" diff --git a/jest-integration/tests/functions/4-add-binding-back/expectedOutput.json b/jest-integration/tests/functions/4-add-binding-back/expectedOutput.json index 9836eb5..88641cc 100644 --- a/jest-integration/tests/functions/4-add-binding-back/expectedOutput.json +++ b/jest-integration/tests/functions/4-add-binding-back/expectedOutput.json @@ -8,6 +8,7 @@ "numRuntimeErrorTestSuites": 0, "numTotalTestSuites": 1, "numTotalTests": 1, + "openHandles": [], "snapshot": { "added": 0, "didUpdate": false, @@ -19,6 +20,7 @@ "matched": 0, "total": 1, "unchecked": 0, + "uncheckedKeysByFile": [], "unmatched": 1, "updated": 0 }, @@ -34,11 +36,12 @@ "UnexpectedError: \nexpected \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 \n", + "message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n expected \n\n 14 | \n 15 | const renderer = TestRenderer.create();\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": "" diff --git a/jest-integration/tests/multiple/3-change-in-code/expectedOutput.json b/jest-integration/tests/multiple/3-change-in-code/expectedOutput.json index 40f4ab7..a11ade1 100644 --- a/jest-integration/tests/multiple/3-change-in-code/expectedOutput.json +++ b/jest-integration/tests/multiple/3-change-in-code/expectedOutput.json @@ -8,6 +8,7 @@ "numRuntimeErrorTestSuites": 0, "numTotalTestSuites": 2, "numTotalTests": 5, + "openHandles": [], "snapshot": { "added": 0, "didUpdate": false, @@ -19,6 +20,7 @@ "matched": 4, "total": 6, "unchecked": 0, + "uncheckedKeysByFile": [], "unmatched": 2, "updated": 0 }, @@ -27,14 +29,19 @@ { "assertionResults": [ { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ "UnexpectedError: \nexpected\n\nwith event click with event click 'with event click' to match snapshot\n\n\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 \n with event click with event click 'with event click' to match snapshot\n \n \n", + "message": " ● ClickCounter › counts a single click\n\n UnexpectedError: \n expected\n \n with event click with event click 'with event click' to match snapshot\n\n \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();\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": "" @@ -42,29 +49,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\nwith event click with event click 'with event click' with event click 'to match snapshot'\n\n\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 \n with event click with event click 'with event click' with event click 'to match snapshot'\n \n \n", + "message": " ● ClickCounter › counts multiple clicks\n\n UnexpectedError: \n expected\n \n with event click with event click 'with event click' with event click 'to match snapshot'\n\n \n\n 24 | it('counts multiple clicks', function () {\n 25 | const renderer = TestRenderer.create();\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": "" diff --git a/jest-integration/tests/wrong-require/1-failures/expectedOutput.json b/jest-integration/tests/wrong-require/1-failures/expectedOutput.json index 76a7f7b..7eb366e 100644 --- a/jest-integration/tests/wrong-require/1-failures/expectedOutput.json +++ b/jest-integration/tests/wrong-require/1-failures/expectedOutput.json @@ -8,6 +8,7 @@ "numRuntimeErrorTestSuites": 0, "numTotalTestSuites": 1, "numTotalTests": 4, + "openHandles": [], "snapshot": { "added": 0, "didUpdate": false, @@ -19,6 +20,7 @@ "matched": 0, "total": 0, "unchecked": 0, + "uncheckedKeysByFile": [], "unmatched": 0, "updated": 0 }, @@ -27,35 +29,55 @@ { "assertionResults": [ { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ "UnexpectedError: \nexpected when rendered\nTo use the `to satisfy snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n" ], + "fullName": "ClickCounter renders with `when rendered to satisfy`", + "location": null, "status": "failed", "title": "renders with `when rendered to satisfy`" }, { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ "UnexpectedError: \nexpected when rendered\nTo use the `to match snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n" ], + "fullName": "ClickCounter renders with `when rendered`", + "location": null, "status": "failed", "title": "renders with `when rendered`" }, { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ "UnexpectedError: \nTo use the `to match snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n" ], + "fullName": "ClickCounter renders with default props", + "location": null, "status": "failed", "title": "renders with default props" }, { + "ancestorTitles": [ + "ClickCounter" + ], "failureMessages": [ "UnexpectedError: \nTo use the `to satisfy snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n" ], + "fullName": "ClickCounter renders with default props with to satisfy", + "location": null, "status": "failed", "title": "renders with default props with to satisfy" } ], - "message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n To use the `to match snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n", + "message": " ● ClickCounter › renders with default props\n\n UnexpectedError: \n To use the `to match snapshot` assertion with the shallow and full DOM renderers, require unexpected-react as `require('unexpected-react/jest');`\n\n 15 | renderer.render();\n 16 | // This will fail as we've not included the unexpected-react/jest\n > 17 | expect(renderer, 'to match snapshot');\n | ^\n 18 | });\n 19 | \n 20 | it('renders with `when rendered`', function () {\n", "name": "/src/__tests__/ClickCounter.spec.js", "status": "failed", "summary": ""