From faf9d901c12df8e149fffcd3442eb7159d64c97a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Sat, 13 Nov 2021 00:29:51 -0800 Subject: [PATCH] chore: fix test to work on Windows with auto.crlf = false (#10296) --- tests/page/page-request-intercept.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/page/page-request-intercept.spec.ts b/tests/page/page-request-intercept.spec.ts index ff5c3cd1ee..e32af3e927 100644 --- a/tests/page/page-request-intercept.spec.ts +++ b/tests/page/page-request-intercept.spec.ts @@ -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('Woof-Woof' + 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 }) => {