diff --git a/tests/snapshotter.spec.ts b/tests/snapshotter.spec.ts index 7ebf2245d5..8807017e6a 100644 --- a/tests/snapshotter.spec.ts +++ b/tests/snapshotter.spec.ts @@ -153,12 +153,12 @@ it.describe('snapshots', () => { { const handle = await page.$('text=Hello'); const snapshot = await snapshotter.captureSnapshot(toImpl(page), 'snapshot', toImpl(handle)); - expect(distillSnapshot(snapshot)).toBe(''); + expect(distillSnapshot(snapshot)).toBe(''); } { const handle = await page.$('text=World'); const snapshot = await snapshotter.captureSnapshot(toImpl(page), 'snapshot2', toImpl(handle)); - expect(distillSnapshot(snapshot)).toBe(''); + expect(distillSnapshot(snapshot)).toBe(''); } }); @@ -192,7 +192,7 @@ function distillSnapshot(snapshot) { .replace(//, '') .replace(/<\/HTML>/, '') .replace(//, '') - .replace(/\s__playwright_target__="[^"]+"/, '') + .replace(/\s__playwright_target__="[^"]+"/g, '') .replace(/<\/HEAD>/, '') .replace(//, '') .replace(/<\/BODY>/, '').trim();