From fee9b6007fcb9989b27a6f389f24b0a1290cd828 Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Fri, 1 Apr 2022 13:12:29 -0700 Subject: [PATCH] test: fix windows paths in golden.spec (#13258) --- tests/playwright-test/golden.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/playwright-test/golden.spec.ts b/tests/playwright-test/golden.spec.ts index ad48d5a5bc..e816ef9402 100644 --- a/tests/playwright-test/golden.spec.ts +++ b/tests/playwright-test/golden.spec.ts @@ -770,8 +770,10 @@ test('should attach expected/actual/diff with snapshot path', async ({ runInline const outputText = stripAnsi(result.output); const attachments = outputText.split('\n').filter(l => l.startsWith('## ')).map(l => l.substring(3)).map(l => JSON.parse(l))[0]; - for (const attachment of attachments) + for (const attachment of attachments) { attachment.path = attachment.path.replace(/\\/g, '/').replace(/.*test-results\//, ''); + attachment.name = attachment.name.replace(/\\/g, '/'); + } expect(attachments).toEqual([ { name: 'test/path/snapshot-expected.png',