From 3c6eac9b218c6ebf354052f5a94878a0768d32a8 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Fri, 1 Aug 2025 18:19:03 -0700 Subject: [PATCH] chore: follow up with win test fix (#818) --- tests/roots.spec.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/roots.spec.ts b/tests/roots.spec.ts index 4c7aa0e..9c8bb01 100644 --- a/tests/roots.spec.ts +++ b/tests/roots.spec.ts @@ -21,13 +21,15 @@ import { pathToFileURL } from 'url'; import { test, expect } from './fixtures.js'; import { createHash } from '../src/utils.js'; +const p = process.platform === 'win32' ? 'c:\\non\\existent\\folder' : '/non/existent/folder'; + test('should use separate user data by root path', async ({ startClient, server }, testInfo) => { const { client } = await startClient({ roots: [ { name: 'test', - uri: 'file:///non/existent/folder', - }, + uri: 'file://' + p.replace(/\\/g, '/'), + } ], }); @@ -36,7 +38,7 @@ test('should use separate user data by root path', async ({ startClient, server arguments: { url: server.HELLO_WORLD }, }); - const hash = createHash('/non/existent/folder'); + const hash = createHash(p); const [file] = await fs.promises.readdir(testInfo.outputPath('ms-playwright')); expect(file).toContain(hash); });