Closed skanaar closed 1 year ago
Using the assert methods from node:assert does not properly fail a test. Instead a toast with this message pops up:
node:assert
Worker executed with code 1: /Users/kallin/.vscode/extensions/connor4312.nodejs-testing-1.0.2/out/runner-worker.js:206
But explicitly throwing an Error properly fails the test.
VS Code: 1.76.1 nodejs-testing: v1.0.2
Sample test file
import { test } from 'node:test' import { deepEqual } from 'node:assert' test('should pass', () => { deepEqual({ foo: 'bar' }, { foo: 'bar' }) }) test('will fail properly', () => { throw new Error('fail') }) test('will not fail properly', () => { deepEqual({ foo: 'bar' }, { foo: 'x' }) })
State of my editor
Unfortunately this is a Node.js bug: https://github.com/nodejs/node/issues/47075
Oh! 😨 Nice bug report in Node, looks like they are addressing it.
Using the assert methods from
node:assert
does not properly fail a test. Instead a toast with this message pops up:Worker executed with code 1: /Users/kallin/.vscode/extensions/connor4312.nodejs-testing-1.0.2/out/runner-worker.js:206
But explicitly throwing an Error properly fails the test.
VS Code: 1.76.1 nodejs-testing: v1.0.2
Sample test file
State of my editor