Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-min authored and DylanPiercey committed May 29, 2024
1 parent 231288c commit 227c5b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class {

<button onClick("loadSlot1")>Load Slot1</button>
<if(state.mounted)>
<micro-frame-sse src="embed" name="test" read(e) { return [e.lastEventId, e.data, true] } />
<micro-frame-sse src="embed" name="test" read(e) { if (e.data === "error") { throw new Error("error"); } else { return [e.lastEventId, e.data, true] } } />
<micro-frame-slot from="test" slot="slot_2">
<@loading>
Loading...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $ const slot_1_html = fs.readFileSync(path.resolve(__dirname ,'slot_1.html'), 'u
$ const slot_2_html = fs.readFileSync(path.resolve(__dirname ,'slot_2.html'), 'utf8');
$ const first = `id: slot_1\ndata: ${slot_1_html.replace(/\r?\n/g, '')}\n\n`;
$ const second = `id: slot_2\ndata: ${slot_2_html.replace(/\r?\n/g, '')}\n\n`;
$ const third = `id: slot_1\ndata: next chunk for slot_1\n\n`;
$ const third = `id: slot_1\ndata: error\n\n`;

<await(wait())>
<@then>
Expand All @@ -17,7 +17,6 @@ $ const third = `id: slot_1\ndata: next chunk for slot_1\n\n`;
<await(wait())>
<@then>
$!{third}
<await(new Promise((_, reject) => setTimeout(() => reject("Error"), 100))) />
</@then>
</await>
</@then>
Expand Down

0 comments on commit 227c5b9

Please sign in to comment.