test: run "should remove temp dir on process.exit" on windows (#13568)
This commit is contained in:
parent
aee6ba299a
commit
022f83d3b4
|
|
@ -32,6 +32,18 @@ test('should close the browser when the node process closes', async ({ startRemo
|
|||
expect(await remoteServer.childExitCode()).toBe(isWindows ? 1 : 0);
|
||||
});
|
||||
|
||||
test('should remove temp dir on process.exit', async ({ startRemoteServer, server }, testInfo) => {
|
||||
const file = testInfo.outputPath('exit.file');
|
||||
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE, exitOnFile: file });
|
||||
const tempDir = await remoteServer.out('tempDir');
|
||||
const before = fs.existsSync(tempDir);
|
||||
fs.writeFileSync(file, 'data', 'utf-8');
|
||||
expect(await remoteServer.childExitCode()).toBe(42);
|
||||
const after = fs.existsSync(tempDir);
|
||||
expect(before).toBe(true);
|
||||
expect(after).toBe(false);
|
||||
});
|
||||
|
||||
test.describe('signals', () => {
|
||||
test.skip(({ platform }) => platform === 'win32');
|
||||
|
||||
|
|
@ -96,18 +108,6 @@ test.describe('signals', () => {
|
|||
expect(after).toBe(false);
|
||||
});
|
||||
|
||||
test('should remove temp dir on process.exit', async ({ startRemoteServer, server }, testInfo) => {
|
||||
const file = testInfo.outputPath('exit.file');
|
||||
const remoteServer = await startRemoteServer({ url: server.EMPTY_PAGE, exitOnFile: file });
|
||||
const tempDir = await remoteServer.out('tempDir');
|
||||
const before = fs.existsSync(tempDir);
|
||||
fs.writeFileSync(file, 'data', 'utf-8');
|
||||
expect(await remoteServer.childExitCode()).toBe(42);
|
||||
const after = fs.existsSync(tempDir);
|
||||
expect(before).toBe(true);
|
||||
expect(after).toBe(false);
|
||||
});
|
||||
|
||||
test('should kill the browser on SIGINT + SIGTERM', async ({ startRemoteServer, server }) => {
|
||||
const remoteServer = await startRemoteServer({ stallOnClose: true, url: server.EMPTY_PAGE });
|
||||
process.kill(remoteServer.child().pid, 'SIGINT');
|
||||
|
|
|
|||
Loading…
Reference in New Issue