You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems there is some odd behavior with only and subtests, because I expected the following to pass:
consttest=require('node:test')test('this should be run',{only: true},(t)=>{t.test('this should be run',{only: true},(t)=>{})t.test('this should not be run',(t)=>{})})
But it's failing with an odd error
▶ this should be run
✔ this should be run (0.320833ms)
✖ this should not be run (0.216167ms)
'test did not finish before its parent and was cancelled'
▶ this should be run (1.850417ms)
ℹ tests 3
ℹ suites 0
ℹ pass 1
ℹ fail 1
ℹ cancelled 1
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 0.11275
✖ failing tests:
✖ this should not be run (0.216167ms)
'test did not finish before its parent and was cancelled'
The text was updated successfully, but these errors were encountered:
When a test with the only option set is run, all subtests are also run. The test context's runOnly() method can be used to implement the same behavior at the subtest level.
@MoLow is already looking at improving this experience in #48932, so I'll close this issue.
It seems there is some odd behavior with
only
and subtests, because I expected the following to pass:But it's failing with an odd error
The text was updated successfully, but these errors were encountered: