test: fix windows paths in golden.spec (#13258)

This commit is contained in:
Dmitry Gozman 2022-04-01 13:12:29 -07:00 committed by GitHub
parent c262a80762
commit fee9b6007f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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',