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 9aecfd84_ad15_8897_6d0f_d4362f64c708["default.test()"] 6e65a2b2_2a10_aa5b_51e0_913bb69346b8["_config.js"] 9aecfd84_ad15_8897_6d0f_d4362f64c708 -->|defined in| 6e65a2b2_2a10_aa5b_51e0_913bb69346b8 style 9aecfd84_ad15_8897_6d0f_d4362f64c708 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/tests/runtime-legacy/samples/spread-element-input-select-multiple/_config.js lines 5–44
test({ assert, component, target, window }) {
const [input1, input2] = target.querySelectorAll('input');
const select = target.querySelector('select');
ok(select);
const [option1, option2] = /** @type {NodeListOf<HTMLOptionElement>} */ (select.childNodes);
let selections = Array.from(select.selectedOptions);
assert.equal(selections.length, 2);
assert.ok(selections.includes(option1));
assert.ok(selections.includes(option2));
const event = new window.Event('change');
input1.checked = false;
input1.dispatchEvent(event);
flushSync();
selections = Array.from(select.selectedOptions);
assert.equal(selections.length, 1);
assert.ok(!selections.includes(option1));
assert.ok(selections.includes(option2));
input2.checked = false;
input2.dispatchEvent(event);
flushSync();
input1.checked = true;
input1.dispatchEvent(event);
flushSync();
selections = Array.from(select.selectedOptions);
assert.equal(selections.length, 1);
assert.ok(selections.includes(option1));
assert.ok(!selections.includes(option2));
component.spread = { value: ['Hello', 'World'] };
selections = Array.from(select.selectedOptions);
assert.equal(selections.length, 2);
assert.ok(selections.includes(option1));
assert.ok(selections.includes(option2));
}
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/spread-element-input-select-multiple/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/spread-element-input-select-multiple/_config.js at line 5.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free