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 7474a1ed_1049_a39c_5baf_c8d0dc4498a6["default.test()"] 02183c06_0854_5dbc_b6fb_a5b64dff6704["_config.js"] 7474a1ed_1049_a39c_5baf_c8d0dc4498a6 -->|defined in| 02183c06_0854_5dbc_b6fb_a5b64dff6704 style 7474a1ed_1049_a39c_5baf_c8d0dc4498a6 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/tests/runtime-legacy/samples/binding-input-text-contextual-reactive/_config.js lines 39–133
test({ assert, component, target, window }) {
/**
* @param {number} i
* @param {string} text
*/
function set_text(i, text) {
const input = /** @type {HTMLInputElement} */ (
target.querySelectorAll('input[type="text"]')[i]
);
input.value = text;
input.dispatchEvent(new window.Event('input'));
}
/**
* @param {number} i
* @param {boolean} done
*/
function set_done(i, done) {
const input = /** @type {HTMLInputElement} */ (
target.querySelectorAll('input[type="checkbox"]')[i]
);
input.checked = done;
input.dispatchEvent(new window.Event('change'));
}
component.filter = 'remaining';
assert.htmlEqual(
target.innerHTML,
`
<div>
<input type="checkbox">
<input type="text"><p>one</p>
</div>
<div>
<input type="checkbox">
<input type="text"><p>three</p>
</div>
<p>remaining:one / done:two / remaining:three</p>
`
);
set_text(1, 'four');
flushSync();
assert.htmlEqual(
target.innerHTML,
`
<div>
<input type="checkbox">
<input type="text"><p>one</p>
</div>
<div>
<input type="checkbox">
<input type="text"><p>four</p>
</div>
<p>remaining:one / done:two / remaining:four</p>
`
);
set_done(0, true);
flushSync();
assert.htmlEqual(
target.innerHTML,
`
<div>
<input type="checkbox">
<input type="text"><p>four</p>
</div>
<p>done:one / done:two / remaining:four</p>
`
);
component.filter = 'done';
assert.htmlEqual(
target.innerHTML,
Domain
Subdomains
Defined In
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/binding-input-text-contextual-reactive/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/binding-input-text-contextual-reactive/_config.js at line 39.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free