Skip to content

Commit 5d6dbbb

Browse files
authored
Fix async assertions in test files (#1510)
* fix: await assertSnapshot in test files for async assertions
1 parent 47b0fbb commit 5d6dbbb

File tree

8 files changed

+94
-92
lines changed

8 files changed

+94
-92
lines changed

.changeset/bright-socks-clap.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/all/test/cross-origin-iframe-packer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ describe('cross origin iframes & packer', function (this: ISuite) {
149149
const unpackedSnapshots = packedSnapshots.map((packed) =>
150150
unpack(packed),
151151
) as eventWithTime[];
152-
assertSnapshot(unpackedSnapshots);
152+
await assertSnapshot(unpackedSnapshots);
153153
});
154154
});
155155
});

packages/plugins/rrweb-plugin-console-record/test/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('rrweb-plugin-console-record', () => {
8787
'window.snapshots',
8888
)) as eventWithTime[];
8989
// The snapshots should containe 1 console log, not multiple.
90-
assertSnapshot(snapshots);
90+
await assertSnapshot(snapshots);
9191
});
9292

9393
it('should record console messages', async () => {
@@ -123,6 +123,6 @@ describe('rrweb-plugin-console-record', () => {
123123
const snapshots = (await page.evaluate(
124124
'window.snapshots',
125125
)) as eventWithTime[];
126-
assertSnapshot(snapshots);
126+
await assertSnapshot(snapshots);
127127
});
128128
});

packages/rrweb-snapshot/test/integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('integration tests', function (this: ISuite) {
153153
'blob:http://localhost:xxxx/...',
154154
);
155155

156-
assertSnapshot(rebuildHtml);
156+
await assertSnapshot(rebuildHtml);
157157
});
158158
}
159159

@@ -427,7 +427,7 @@ describe('iframe integration tests', function (this: ISuite) {
427427
null,
428428
2,
429429
);
430-
assertSnapshot(snapshotResult);
430+
await assertSnapshot(snapshotResult);
431431
});
432432
});
433433

@@ -470,6 +470,6 @@ describe('shadow DOM integration tests', function (this: ISuite) {
470470
null,
471471
2,
472472
);
473-
assertSnapshot(snapshotResult);
473+
await assertSnapshot(snapshotResult);
474474
});
475475
});

0 commit comments

Comments
 (0)