I have a few e2e tests, one of them hangs and we can't find out why, so we want to use --forceExit. But, we don't want to force exit all the tests just a particular one because we use github actions + npm script to run these e2e tests.
How would I do that?
Hard to help without further information on your part.
However, if you want to quit a running test, you can always use a return statement.
For example (all tests should pass):
describe("exit a test", () => {
it("good test 1", () => {
const aSum = 1;
expect(aSum).toBe(1);
});
it("uses a flag and a return statement to prevent test from failing", () => {
const flag = true;
if (flag) {
return;
}
expect(flag).toBeFalsy();
});
it("good test 2", () => {
const aSum = 1;
expect(aSum).toBe(1);
});
});