-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
What is the problem this feature will solve?
A test's progress can sometimes be crucial for the next one, if one of them fails, say like this:
let module;
let instance;
test("importing module", async () => {
module = await import("...");
});
test("using module feature 1", () => {
instance = new module.SomeExportedClass("arg1", { option: true });
});
test("request to API", async () => {
await instance.apiEndpoint({ ... });
});
While yes, if the library has checks, this would be pointless, but it would be better to have an option for the the rest of the tests to fail if one had failed.
What is the feature you are proposing to solve the problem?
Something like this:
test("test for myModule", { fastFail: true }, (t) => {
t("test that fails", () => {
// This should make the next tests to fail as well.
assert(false);
});
t("test that will never succeed", () => {
console.log("This won't log to the console.");
});
});
What alternatives have you considered?
No response
styfle, EndangeredMassa, Pheromon, pongo, nicholaswmin and 3 more
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.