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 43146ad1_c69e_f3d4_06aa_848c7872fa8b["default.test()"] fa8f7610_1c0b_bc7b_d1d3_96256050a795["_config.js"] 43146ad1_c69e_f3d4_06aa_848c7872fa8b -->|defined in| fa8f7610_1c0b_bc7b_d1d3_96256050a795 style 43146ad1_c69e_f3d4_06aa_848c7872fa8b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/tests/runtime-runes/samples/class-directive-mutations/_config.js lines 45–125
async test({ target, assert, component, instance }) {
flushSync();
tick();
assert.deepEqual(instance.get_and_clear_mutations(), ['MAIN']);
component.foo = false;
flushSync();
tick();
assert.deepEqual(
instance.get_and_clear_mutations(),
['DIV', 'SPAN', 'B', 'I', 'DIV', 'SPAN', 'B', 'I'],
'first mutation'
);
assert.htmlEqual(
target.innerHTML,
`
<main id="main" class="browser">
<div class="custom svelte-1cjqok6 bar" title="a title"></div>
<span class="svelte-1cjqok6 bar"></span>
<b class="custom bar"></b>
<i class="bar"></i>
<div class="custom svelte-1cjqok6 bar" title="a title"></div>
<span class="svelte-1cjqok6 bar"></span>
<b class="custom bar"></b>
<i class="bar"></i>
</main>
`
);
component.foo = true;
flushSync();
assert.deepEqual(
instance.get_and_clear_mutations(),
['DIV', 'SPAN', 'B', 'I', 'DIV', 'SPAN', 'B', 'I'],
'second mutation'
);
assert.htmlEqual(
target.innerHTML,
`
<main id="main" class="browser">
<div class="custom svelte-1cjqok6 bar foo" title="a title"></div>
<span class="svelte-1cjqok6 bar foo"></span>
<b class="custom bar foo"></b>
<i class="bar foo"></i>
<div class="custom svelte-1cjqok6 bar foo" title="a title"></div>
<span class="svelte-1cjqok6 bar foo"></span>
<b class="custom bar foo"></b>
<i class="bar foo"></i>
</main>
`
);
component.classname = 'another';
flushSync();
assert.deepEqual(
instance.get_and_clear_mutations(),
['DIV', 'B', 'DIV', 'B'],
'class mutation'
);
assert.htmlEqual(
target.innerHTML,
`
<main id="main" class="browser">
<div class="another svelte-1cjqok6 foo bar" title="a title"></div>
<span class="svelte-1cjqok6 bar foo"></span>
<b class="another foo bar"></b>
<i class="bar foo"></i>
<div class="another svelte-1cjqok6 foo bar" title="a title"></div>
<span class="svelte-1cjqok6 bar foo"></span>
<b class="another foo bar"></b>
<i class="bar foo"></i>
</main>
`
);
}
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-runes/samples/class-directive-mutations/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-runes/samples/class-directive-mutations/_config.js at line 45.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free