hbenl / vscode-jasmine-test-adapter

Jasmine Test Adapter for the VS Code Test Explorer
MIT License
20 stars 20 forks source link

Circular data causes an error in failed tests. #35

Closed Dave-Baum closed 5 years ago

Dave-Baum commented 5 years ago

If a test fails and the actual value is some sort of circular data structure, then an error is thrown when trying to JSON encode the failure event. As a result the test status does not update in the test explorer. For example, this test:

it('test', () => { const x: any[] = []; x.push(x); expect(x).toEqual([]); });

Leads to this output:

Suite error: undefined Message:  TypeError: Converting circular structure to JSON Stack: at at process.target._send (internal/child_process.js:675:23) at process.target.send (internal/child_process.js:586:19) at RunTestsReporter.process.send [as sendMessage] (/Users/dave/.vscode/extensions/hbenl.vscode-jasmine-test-adapter-1.6.0/out/worker/runTests.js:6:57) at RunTestsReporter.specDone (/Users/dave/.vscode/extensions/hbenl.vscode-jasmine-test-adapter-1.6.0/out/worker/runTestsReporter.js:36:18) at

hbenl commented 5 years ago

Thanks, this is fixed in version 1.6.1.

Dave-Baum commented 5 years ago

Thank you for the quick fix - it works perfectly.