added NONE_ISOLATED for beforeAll,afterAll,beforeEach,afterEach

This commit is contained in:
Siarhei_Kliushnikau 2024-09-22 14:01:47 +02:00
parent 315f6dfc2e
commit a1d512f0c3

View file

@ -396,7 +396,7 @@ export class WorkerMain extends ProcessRunner {
// In case of failure the worker will be stopped and we have to make sure that afterAll // In case of failure the worker will be stopped and we have to make sure that afterAll
// hooks run before worker fixtures teardown. // hooks run before worker fixtures teardown.
for (const suite of reversedSuites) { for (const suite of reversedSuites) {
if (!nextSuites.has(suite) || testInfo._isFailure()) { if (!nextSuites.has(suite) || (testInfo._isFailure() && !process.env.NOT_ISOLATED)) {
try { try {
await this._runAfterAllHooksForSuite(suite, testInfo); await this._runAfterAllHooksForSuite(suite, testInfo);
} catch (error) { } catch (error) {
@ -534,8 +534,11 @@ export class WorkerMain extends ProcessRunner {
} }
} }
} }
if (firstError) if (firstError) {
if (process.env.NONE_ISOLATED)
this._didRunFullCleanup = true;
throw firstError; throw firstError;
}
} }
private async _runAfterAllHooksForSuite(suite: Suite, testInfo: TestInfoImpl) { private async _runAfterAllHooksForSuite(suite: Suite, testInfo: TestInfoImpl) {