Skip to content

Commit

Permalink
Fix async assertions in test files (#1510)
Browse files Browse the repository at this point in the history
* fix: await assertSnapshot in test files for async assertions
  • Loading branch information
Juice10 committed Jun 18, 2024
1 parent 47b0fbb commit 5d6dbbb
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .changeset/bright-socks-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion packages/all/test/cross-origin-iframe-packer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('cross origin iframes & packer', function (this: ISuite) {
const unpackedSnapshots = packedSnapshots.map((packed) =>
unpack(packed),
) as eventWithTime[];
assertSnapshot(unpackedSnapshots);
await assertSnapshot(unpackedSnapshots);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('rrweb-plugin-console-record', () => {
'window.snapshots',
)) as eventWithTime[];
// The snapshots should containe 1 console log, not multiple.
assertSnapshot(snapshots);
await assertSnapshot(snapshots);
});

it('should record console messages', async () => {
Expand Down Expand Up @@ -123,6 +123,6 @@ describe('rrweb-plugin-console-record', () => {
const snapshots = (await page.evaluate(
'window.snapshots',
)) as eventWithTime[];
assertSnapshot(snapshots);
await assertSnapshot(snapshots);
});
});
6 changes: 3 additions & 3 deletions packages/rrweb-snapshot/test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('integration tests', function (this: ISuite) {
'blob:http://localhost:xxxx/...',
);

assertSnapshot(rebuildHtml);
await assertSnapshot(rebuildHtml);
});
}

Expand Down Expand Up @@ -427,7 +427,7 @@ describe('iframe integration tests', function (this: ISuite) {
null,
2,
);
assertSnapshot(snapshotResult);
await assertSnapshot(snapshotResult);
});
});

Expand Down Expand Up @@ -470,6 +470,6 @@ describe('shadow DOM integration tests', function (this: ISuite) {
null,
2,
);
assertSnapshot(snapshotResult);
await assertSnapshot(snapshotResult);
});
});
Loading

0 comments on commit 5d6dbbb

Please sign in to comment.