-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix running bun test on multiple node:test tests
#19354
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
Conversation
|
@190n If this can help you potentially debug, I can still make the tests be skipped under certain circumstances, take this snippet for example: import { test, after } from 'node:test'
import { strict as assert } from 'node:assert'
import { build } from '../helper'
import type { FastifyInstance } from 'fastify'
after(async () => {
// Cleanup logic if needed
})
test('resource routes', async () => {
const app: FastifyInstance = await build()
await test('should create and update a resource', async () => {
throw new Error('this should fail the test')
})
})When this is ran, the inner test does not get executed (doesn't show up in the console list nor is the thrown error catched/visible) |
|
It looks like we don't intend to support that yet: Lines 146 to 148 in 3278969
I think this will be an effort for a different PR. However, I will see if I can figure out why the error isn't being thrown, since that could probably be confusing. |
|
@jordanebelanger thanks for bringing this up, the issue was we would only throw the error if you used the context, e.g. using We'll add support for nested tests someday but that's outside the scope of this PR. I think providing an error in this case is still a worthwhile improvement over status quo. |
dylan-conway
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments, looks good afterwards
What does this PR do?
Fixes #19200
How did you verify your code works?
Added to
node-test.test.ts