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

Relationship Graph

Source Code

packages/svelte/tests/runtime-runes/samples/optgroup-rich-content/_config.js lines 7–30

	test({ assert, target }) {
		const select = /** @type {HTMLSelectElement} */ (target.querySelector('select'));
		const optgroups = target.querySelectorAll('optgroup');
		const options = target.querySelectorAll('option');
		const button = /** @type {HTMLButtonElement} */ (target.querySelector('button'));

		assert.ok(select);
		assert.equal(optgroups.length, 2);
		assert.equal(options.length, 4);

		// Check initial option content (rich content inside optgroup)
		assert.equal(options[0]?.textContent, 'apple apple');
		assert.equal(options[1]?.textContent, 'banana');
		assert.equal(options[2]?.textContent, 'carrot carrot');
		assert.equal(options[3]?.textContent, 'Plain celery');

		// Click button to change dynamic content
		button.click();
		flushSync();

		// Check updated option content
		assert.equal(options[0]?.textContent, 'orange orange');
		assert.equal(options[2]?.textContent, 'broccoli broccoli');
	}

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-runes/samples/optgroup-rich-content/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-runes/samples/optgroup-rich-content/_config.js at line 7.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free