-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
node:test
describe filter
#47281
Comments
Thanks for the report. Currently, you can specify |
Specify Doing so will call $ node --test-reporter=spec --test-name-pattern=cheapFn --test-name-pattern='.*' ./test.mjs
calling cheapFn(0)
calling cheapFn(1)
▶ cheapFn
✔ doesNotReject (2.859524ms)
calling expensiveFn(0)
✔ rejects (0.491546ms)
▶ cheapFn (5.284205ms)
calling expensiveFn(1)
▶ expensiveFn
✔ doesNotReject (3003.84589ms)
✔ rejects (3004.548911ms)
▶ expensiveFn (6009.70523ms) |
It works, it's just clunky and can definitely be improved (#46728 😄). You're passing a pattern of |
I just want to match everything under cheapFn, but seems repeatable |
What is the problem this feature will solve?
What is the feature you are proposing to solve the problem?
Reproduce
lib.mjs
code
test.mjs
code
Actual
describe(cheapFn)
is matched, but childit()
are all skipped.Expected
$ node --test-reporter=spec --group-name-pattern=cheapFn ./test.mjs calling cheapFn(0) calling cheapFn(1) ▶ cheapFn ✔ doesNotReject (2.892296ms) ✔ rejects (0.523082ms) ▶ cheapFn (5.236258ms) ﹣ expensiveFn (0.068014ms) # SKIP ℹ tests 2 ℹ pass 1 ℹ fail 0 ℹ cancelled 0 ℹ skipped 1 ℹ todo 0 ℹ duration_ms 9.044444
describe(cheapFn)
is matched, are childit()
are all matched, unlessit()
conflict with--test-name-pattern
What alternatives have you considered?
Join nested name, and match against
test-name-pattern
.This will be super simple, but
test-name-pattern
Something like
The text was updated successfully, but these errors were encountered: