format/lint

pull/13241/head
adiguba 2 years ago
parent 6954238f4a
commit 31b5e27e35

@ -2,10 +2,9 @@ import { flushSync } from 'svelte';
import { test } from '../../test'; import { test } from '../../test';
export default test({ export default test({
async test({ component, assert, target, logs}) { async test({ component, assert, target, logs }) {
// Set a promise on the component // Set a promise on the component
const p1 = new Promise( (resolve) => setTimeout(resolve, 32) ); const p1 = new Promise((resolve) => setTimeout(resolve, 32));
component.promise = p1; component.promise = p1;
// And wait the end of the promise // And wait the end of the promise
await p1; await p1;
@ -17,15 +16,15 @@ export default test({
logs.length = 0; logs.length = 0;
// Set a promise on the component // Set a promise on the component
const p2 = new Promise( (resolve) => setTimeout(resolve, 32) ); const p2 = new Promise((resolve) => setTimeout(resolve, 32));
component.promise = p2 component.promise = p2;
// Clear the component's promise // Clear the component's promise
await Promise.resolve(); await Promise.resolve();
component.promise = null; component.promise = null;
// Wait for the end of the initial promise // Wait for the end of the initial promise
await p2; await p2;
// More wait to avoid scheduling problems // More wait to avoid scheduling problems
await new Promise( (resolve) => setTimeout(resolve, 32) ); await new Promise((resolve) => setTimeout(resolve, 32));
// Only {#await} block must be rendered // Only {#await} block must be rendered
assert.deepEqual(logs, ['await']); assert.deepEqual(logs, ['await']);
} }

Loading…
Cancel
Save