Skip to content

Commit

Permalink
Update snapshot for "Move UI" test
Browse files Browse the repository at this point in the history
For commit 2de09a6.

That commit changes how code is eval:ed. Before:

    const f = new Function(code);
    f();

After:

    await import(`data:text/javascript,${encodeURIComponent(code)}`);

The new approach is slower, causing different timing. The end result is
the same, but the statuses in the snapshot change slightly (from one
valid sequence to another).

I updated the snapshots by temporarily changing the val implementation
to:

    await new Promise((resolve) => {
      setTimeout(resolve, 100);
    });
    const f = new Function(code);
    f();

That is the old implementation, but slowed down. I updated the
snapshots, and then reverted to the new implementation. The tests
passed. This shows that the new implementation is indeed slower, and
that the difference can be explained as a timing thing.
  • Loading branch information
lydell committed Jan 6, 2025
1 parent 9210e2b commit 16cd126
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/Hot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3356,6 +3356,10 @@ describe("hot", () => {
================================================================================
·→
↓↘
▲ ⏳ 13:10:05 Html
================================================================================
·→
↓↘
▲ ✅ 13:10:05 Html
================================================================================
←·
Expand All @@ -3368,6 +3372,10 @@ describe("hot", () => {
================================================================================
←·
↙↓
▲ ⏳ 13:10:05 Html
================================================================================
←·
↙↓
▲ ✅ 13:10:05 Html
================================================================================
↖↑
Expand All @@ -3380,6 +3388,10 @@ describe("hot", () => {
================================================================================
↖↑
←·
▲ ⏳ 13:10:05 Html
================================================================================
↖↑
←·
▲ ✅ 13:10:05 Html
================================================================================
↑↗
Expand All @@ -3392,6 +3404,10 @@ describe("hot", () => {
================================================================================
↑↗
·→
▲ ⏳ 13:10:05 Html
================================================================================
↑↗
·→
▲ ✅ 13:10:05 Html
================================================================================
↖↑
Expand All @@ -3417,10 +3433,6 @@ describe("hot", () => {
·→
↓↘
▲ ✅ 13:10:05 Html
================================================================================
·→
↓↘
▲ ✅ 13:10:05 Html
`);
});

Expand Down

0 comments on commit 16cd126

Please sign in to comment.