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 6a6c71bb_19bc_5f96_c03b_3f6a042ed706["default.test()"] 0e67d19e_a14c_7ec5_d73b_b77bc3a4f7d9["_config.js"] 6a6c71bb_19bc_5f96_c03b_3f6a042ed706 -->|defined in| 0e67d19e_a14c_7ec5_d73b_b77bc3a4f7d9 style 6a6c71bb_19bc_5f96_c03b_3f6a042ed706 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/tests/runtime-legacy/samples/await-with-components/_config.js lines 4–35
async test({ assert, component, target }) {
/** @param {any} value */
let resolve = (value) => {};
/** @param {any} reason */
let reject = (reason) => {};
let promise = new Promise((ok) => (resolve = ok));
component.promise = promise;
assert.htmlEqual(target.innerHTML, 'Loading...');
resolve(42);
await promise;
assert.htmlEqual(target.innerHTML, '42');
promise = new Promise((ok, fail) => (reject = fail));
component.promise = promise;
assert.htmlEqual(target.innerHTML, 'Loading...');
reject(99);
await promise.then(null, () => {});
assert.htmlEqual(target.innerHTML, '99');
promise = new Promise((ok) => (resolve = ok));
component.promise = promise;
assert.htmlEqual(target.innerHTML, 'Loading...');
resolve(1);
await promise;
assert.htmlEqual(target.innerHTML, '1');
}
Domain
Subdomains
Source
Frequently Asked Questions
What does default.test() do?
default.test() is a function in the svelte codebase, defined in packages/svelte/tests/runtime-legacy/samples/await-with-components/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/await-with-components/_config.js at line 4.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free