Fix injectfile test on Windows (#162)

This commit is contained in:
JoelEinbinder 2017-07-28 11:48:41 -07:00 committed by Andrey Lushnikov
parent 8780fcb662
commit 26d97bbe3e

View File

@ -163,16 +163,16 @@ describe('Puppeteer', function() {
describe('Page.injectFile', function() { describe('Page.injectFile', function() {
it('should work', SX(async function() { it('should work', SX(async function() {
const helloPath = path.join(__dirname, './assets/injectedfile.js'); const helloPath = path.join(__dirname, 'assets', 'injectedfile.js');
await page.injectFile(helloPath); await page.injectFile(helloPath);
const result = await page.evaluate(() => __injected); const result = await page.evaluate(() => __injected);
expect(result).toBe(42); expect(result).toBe(42);
})); }));
it('should include sourcemap', SX(async function() { it('should include sourcemap', SX(async function() {
const helloPath = path.join(__dirname, './assets/injectedfile.js'); const helloPath = path.join(__dirname, 'assets', 'injectedfile.js');
await page.injectFile(helloPath); await page.injectFile(helloPath);
const result = await page.evaluate(() => __injectedError.stack); const result = await page.evaluate(() => __injectedError.stack);
expect(result).toContain('assets/injectedfile.js'); expect(result).toContain(path.join('assets', 'injectedfile.js'));
})); }));
}); });