default.test() — svelte Function Reference
Architecture documentation for the default.test() function in _config.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD d303142d_6b59_1b75_4f64_40de432628a7["default.test()"] f12ba047_94da_b808_a152_6597a63a08ae["_config.js"] d303142d_6b59_1b75_4f64_40de432628a7 -->|defined in| f12ba047_94da_b808_a152_6597a63a08ae 5ba24a75_f9f7_4e1e_b3a5_abf5c2a5e5c4["promiseWithResolver()"] d303142d_6b59_1b75_4f64_40de432628a7 -->|calls| 5ba24a75_f9f7_4e1e_b3a5_abf5c2a5e5c4 style d303142d_6b59_1b75_4f64_40de432628a7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/tests/runtime-runes/samples/await-pending-destroy/_config.js lines 19–94
async test({ component, assert, logs }) {
{
// Set a promise on the component
const { promise, resolve } = promiseWithResolver();
component.promise = promise;
// wait for rendering
await Promise.resolve();
// resolve promise
resolve('ok');
// And wait the end of the promise
await promise;
// {#await} and {:then} block must be rendered
assert.deepEqual(logs, ['await', 'then:ok']);
}
// clear logs
logs.length = 0;
{
// Set a promise on the component
const { promise, reject } = promiseWithResolver();
component.promise = promise;
// wait for rendering
await Promise.resolve();
// reject promise
reject('error');
// And wait the end of the promise
await promise.catch((ignore) => {});
// {#await} and {:catch} block must be rendered
assert.deepEqual(logs, ['await', 'catch:error']);
}
// clear logs
logs.length = 0;
{
// Set a promise on the component
const { promise, resolve } = promiseWithResolver();
component.promise = promise;
// wait for rendering
await Promise.resolve();
// remove the promise
component.promise = null;
await Promise.resolve();
// resolve promise
resolve('ok');
// And wait the end of the promise
await promise;
// Only {#await} block must be rendered
assert.deepEqual(logs, ['await']);
}
// clear logs
logs.length = 0;
{
// Set a promise on the component
const { promise, reject } = promiseWithResolver();
component.promise = promise;
// wait for rendering
await tick();
// remove the promise
component.promise = null;
await Promise.resolve();
// reject promise
reject('error');
// And wait the end of the promise
await promise.catch((ignore) => {});
// Only {#await} block must be rendered
assert.deepEqual(logs, ['await']);
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does default.test() do?
default.test() is a function in the svelte codebase, defined in packages/svelte/tests/runtime-runes/samples/await-pending-destroy/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-runes/samples/await-pending-destroy/_config.js at line 19.
What does default.test() call?
default.test() calls 1 function(s): promiseWithResolver.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free