Skip to content

node:assert functions not properly failing tests #5

@skanaar

Description

@skanaar

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

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
Screenshot 2023-03-12 at 19 16 35

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions