-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ansi code escape from jest output #279
Comments
That's a bit strange. Would you have time to debug the extension and see where we've got the bonus ANSI? The output is coming from Jest as JSON using the PR #271 is in the works and should help with the debugger finding |
@seanpoulter |
I'm seeing this as well with the latest plugin on VS Code 1.21.0. Running manually with JSON output: {
"numFailedTestSuites": 1,
"numFailedTests": 1,
"numPassedTestSuites": 0,
"numPassedTests": 1,
"numPendingTestSuites": 0,
"numPendingTests": 0,
"numRuntimeErrorTestSuites": 0,
"numTotalTestSuites": 1,
"numTotalTests": 2,
"snapshot": {
"added": 0,
"didUpdate": false,
"failure": false,
"filesAdded": 0,
"filesRemoved": 0,
"filesUnmatched": 0,
"filesUpdated": 0,
"matched": 0,
"total": 0,
"unchecked": 0,
"uncheckedKeys": [],
"unmatched": 0,
"updated": 0
},
"startTime": 1521571392982,
"success": false,
"testResults": [{
"assertionResults": [{
"ancestorTitles": [],
"failureMessages": [],
"fullName": "adds 1 + 2 to equal 3",
"location": null,
"status": "passed",
"title": "adds 1 + 2 to equal 3"
}, {
"ancestorTitles": [],
"failureMessages": ["Error: \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).toBe(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // Object.is equality\u001b[22m\n\nExpected value to be:\n \u001b[32m6\u001b[39m\nReceived:\n \u001b[31m3\u001b[39m\n at Object.<anonymous>.test (/private/tmp/test/sum.test.js:8:21)\n at Object.asyncFn (/private/tmp/test/node_modules/jest-jasmine2/build/jasmine_async.js:82:37)\n at resolve (/private/tmp/test/node_modules/jest-jasmine2/build/queue_runner.js:52:12)\n at new Promise (<anonymous>)\n at mapper (/private/tmp/test/node_modules/jest-jasmine2/build/queue_runner.js:39:19)\n at promise.then (/private/tmp/test/node_modules/jest-jasmine2/build/queue_runner.js:73:82)\n at <anonymous>\n at process._tickCallback (internal/process/next_tick.js:188:7)"],
"fullName": "should fail",
"location": null,
"status": "failed",
"title": "should fail"
}],
"endTime": 1521571393850,
"message": "\u001b[1m\u001b[31m \u001b[1m● \u001b[1mshould fail\u001b[39m\u001b[22m\n\n \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).toBe(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // Object.is equality\u001b[22m\n \n Expected value to be:\n \u001b[32m6\u001b[39m\n Received:\n \u001b[31m3\u001b[39m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 6 | \u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 7 | \u001b[39mtest(\u001b[32m'should fail'\u001b[39m\u001b[33m,\u001b[39m () \u001b[33m=>\u001b[39m {\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m\u001b[31m\u001b[1m>\u001b[2m\u001b[39m\u001b[90m 8| \u001b[39m expect(sum(\u001b[35m1\u001b[39m\u001b[33m,\u001b[39m \u001b[35m2\u001b[39m))\u001b[33m.\u001b[39mtoBe(\u001b[35m6\u001b[39m)\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 9 | \u001b[39m})\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 10 | \u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[22m\n\u001b[2m \u001b[2mat Object.<anonymous>.test (\u001b[2m\u001b[0m\u001b[36msum.test.js\u001b[39m\u001b[0m\u001b[2m:8:21)\u001b[2m\u001b[22m\n",
"name": "/private/tmp/test/sum.test.js",
"startTime": 1521571393636,
"status": "failed",
"summary": ""
}],
"wasInterrupted": false
} |
Same issue, --no-color does fix this. If that is a workaround for people who aren't using debug, perhaps it's worth documenting? Windows 10 npm -v 5.6.0 |
--no-color fixes it, but it also breaks the ability to debug individual tests, so it won't work as a long term solution. |
It seems like this has been happening since Jest 22.0 and on. I'll add an option to |
Using standard
vue-cli init webpack
upon test errors, I got problems and inline error messages corrupted with ansi codes:
I can hack them out using this in workspace config:
but in that case the 'debug' button will fail saying it is not able to find jest.js:
The text was updated successfully, but these errors were encountered: