Revert "make behaviour congruent for globalTeardown"
This reverts commit 9b785662f6.
This commit is contained in:
parent
d8d044e5ed
commit
d841c675cc
|
|
@ -182,15 +182,10 @@ function createGlobalSetupTask(index: number, length: number): Task<TestRun> {
|
||||||
globalSetupFinished = true;
|
globalSetupFinished = true;
|
||||||
},
|
},
|
||||||
teardown: async ({ config }) => {
|
teardown: async ({ config }) => {
|
||||||
let firstError: any;
|
|
||||||
if (typeof globalSetupResult === 'function')
|
if (typeof globalSetupResult === 'function')
|
||||||
try { await globalSetupResult(); } catch (error) { firstError = error; }
|
await globalSetupResult();
|
||||||
|
|
||||||
if (globalSetupFinished)
|
if (globalSetupFinished)
|
||||||
await teardownHook?.(config.config);
|
await teardownHook?.(config.config);
|
||||||
|
|
||||||
if (firstError)
|
|
||||||
throw firstError;
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -422,7 +422,7 @@ test('globalSetup should support multiple', async ({ runInlineTest }) => {
|
||||||
'globalSetup3Function',
|
'globalSetup3Function',
|
||||||
'globalTeardown2',
|
'globalTeardown2',
|
||||||
'globalSetup1Function',
|
'globalSetup1Function',
|
||||||
'globalTeardown1',
|
// 'globalTeardown1' is missing, because globalSetup1Function errored out.
|
||||||
]);
|
]);
|
||||||
expect(result.output).toContain('Error: kaboom');
|
expect(result.output).toContain('Error: kaboom');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue