core
core copied to clipboard
Match all tags in filter
Description
Currently when providing multiple tags to the config.filters.tags
, any test that matches at least one of the tags will be run. It would be helpful if we could have the option to run tests that match all of the tags. I originally built a plugin to achieve this behavior via .skip()
but the default reporter logs skipped tests to the console, as it should of course. So alternatively, would it be possible to filter out a test in a plugin so that custom filters can be implemented?
Package version
"@japa/expect": "^1.1.4",
"@japa/run-failed-tests": "^1.0.7",
"@japa/runner": "^2.0.7",
"@japa/spec-reporter": "^1.1.12",
Relevant Information
async function (_, runner) {
runner.onSuite((suite) => {
suite.onTest((test) => {
if (!doesTestMatchAllTags(test, tags)) test.skip()
})
suite.onGroup((group) => {
for (const test of group.tests) {
if (!doesTestMatchAllTags(test, tags)) test.skip()
}
})
})
}
Hey! Yup, seems like we need to open a few more APIs to allow filtering tests via plugins. I have added it to my todo
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@thetutlage Might be worth it to only enable the stale bot on issues with a tag such as not enough info
. It seems there were a few other issues in this repo that were needlessly closed
The current workflow works great for us. If an issue needs attention, usually the creator of the issue will remind us about it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Friendly reminder that I'd still appreciate this feature