test: add more logging for a few tests. (#27956)

* test: add logging for app.relaunch test

* test: compare more fields in extension test
This commit is contained in:
Cheng Zhao 2021-03-03 02:34:41 +09:00 committed by GitHub
parent d1145a0f2b
commit ed8e57e424
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View file

@ -286,13 +286,20 @@ describe('app module', () => {
} else if (String(data) === 'true' && state === 'first-launch') {
done();
} else {
done(`Unexpected state: ${state}`);
done(`Unexpected state: "${state}", data: "${data}"`);
}
});
});
const appPath = path.join(fixturesPath, 'api', 'relaunch');
cp.spawn(process.execPath, [appPath]);
const child = cp.spawn(process.execPath, [appPath]);
child.stdout.on('data', (c) => console.log(c.toString()));
child.stderr.on('data', (c) => console.log(c.toString()));
child.on('exit', (code) => {
if (code !== 0) {
done(`Process exited with code ${code}`);
}
});
});
});

View file

@ -152,13 +152,13 @@ describe('chrome extensions', () => {
const [, loadedExtension] = await loadedPromise;
const [, readyExtension] = await emittedOnce(customSession, 'extension-ready');
expect(loadedExtension.id).to.equal(extension.id);
expect(readyExtension.id).to.equal(extension.id);
expect(loadedExtension).to.deep.equal(extension);
expect(readyExtension).to.deep.equal(extension);
const unloadedPromise = emittedOnce(customSession, 'extension-unloaded');
await customSession.removeExtension(extension.id);
const [, unloadedExtension] = await unloadedPromise;
expect(unloadedExtension.id).to.equal(extension.id);
expect(unloadedExtension).to.deep.equal(extension);
});
it('lists loaded extensions in getAllExtensions', async () => {