test: fix windows paths in golden.spec (#13258)
This commit is contained in:
parent
c262a80762
commit
fee9b6007f
|
|
@ -770,8 +770,10 @@ test('should attach expected/actual/diff with snapshot path', async ({ runInline
|
||||||
|
|
||||||
const outputText = stripAnsi(result.output);
|
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];
|
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.path = attachment.path.replace(/\\/g, '/').replace(/.*test-results\//, '');
|
||||||
|
attachment.name = attachment.name.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
expect(attachments).toEqual([
|
expect(attachments).toEqual([
|
||||||
{
|
{
|
||||||
name: 'test/path/snapshot-expected.png',
|
name: 'test/path/snapshot-expected.png',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue