Skip to content
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

async error inside before won't cause test error #52506

Closed
mrbadri opened this issue Apr 12, 2024 · 1 comment
Closed

async error inside before won't cause test error #52506

mrbadri opened this issue Apr 12, 2024 · 1 comment

Comments

@mrbadri
Copy link

mrbadri commented Apr 12, 2024

Version

18, 20, 21

Platform

windows

Subsystem

test_runner

What steps will reproduce the bug?

import { before, test } from 'node:test'
import { createWriteStream } from 'node:fs'

before(() => {
  const fsStream = createWriteStream(new URL('./not-exist/file.txt', import.meta.url), {
    encoding: 'utf8'
  })

  fsStream.write('Hello World')
  fsStream.end()
})

test('ok', () => {

})

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

node --test node-js-fs-stream.mjs
✔ ok (1.033833ms)
ℹ tests 1
ℹ suites 0
ℹ pass 1
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 43.30675

Additional information

No response

@cjihrig
Copy link
Contributor

cjihrig commented Apr 12, 2024

Duplicate of #52399. It's so much of a duplicate that it gives bot vibes 😄

@cjihrig cjihrig closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants