Home / Function/ default.test() — svelte Function Reference

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
  047aff66_3c7c_9298_c2d4_d3ff7bacfcec["default.test()"]
  3bbbd8af_c50c_8663_a0c9_9be42e1d580c["_config.js"]
  047aff66_3c7c_9298_c2d4_d3ff7bacfcec -->|defined in| 3bbbd8af_c50c_8663_a0c9_9be42e1d580c
  style 047aff66_3c7c_9298_c2d4_d3ff7bacfcec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/tests/runtime-legacy/samples/spread-element-input-select/_config.js lines 4–28

	async test({ assert, component, target }) {
		const select = target.querySelector('select');
		ok(select);
		const [option1, option2] = select;

		let selections = Array.from(select.selectedOptions);

		assert.equal(selections.length, 1);
		assert.ok(!selections.includes(option1));
		assert.ok(selections.includes(option2));

		component.value = 'Hello';

		selections = Array.from(select.selectedOptions);
		assert.equal(selections.length, 1);
		assert.ok(selections.includes(option1));
		assert.ok(!selections.includes(option2));

		component.spread = { value: 'World' };

		selections = Array.from(select.selectedOptions);
		assert.equal(selections.length, 1);
		assert.ok(!selections.includes(option1));
		assert.ok(selections.includes(option2));
	}

Domain

Subdomains

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/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/spread-element-input-select/_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