chore: fix test to work on Windows with auto.crlf = false (#10296)

This commit is contained in:
Andrey Lushnikov 2021-11-13 00:29:51 -08:00 committed by GitHub
parent 6a46711347
commit faf9d901c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,9 +15,10 @@
* limitations under the License.
*/
import os from 'os';
import type { Route } from 'playwright-core';
import { expect, test as it } from './pageTest';
import fs from 'fs';
import path from 'path';
it('should fulfill intercepted response', async ({ page, server, isElectron }) => {
it.fixme(isElectron, 'error: Browser context management is not supported.');
@ -108,7 +109,8 @@ it('should support fulfill after intercept', async ({ page, server, isElectron }
const response = await page.goto(server.PREFIX + '/title.html');
const request = await requestPromise;
expect(request.url).toBe('/title.html');
expect(await response.text()).toBe('<title>Woof-Woof</title>' + os.EOL);
const original = await fs.promises.readFile(path.join(__dirname, '..', 'assets', 'title.html'), 'utf8');
expect(await response.text()).toBe(original);
});
it('should give access to the intercepted response', async ({ page, server, isElectron }) => {