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

Relationship Graph

Source Code

packages/svelte/tests/hydration/samples/option-rich-content-static/_config.js lines 18–38

	async test(assert, target) {
		const options = target.querySelectorAll('option');

		// Verify the rich content is present in the options
		assert.equal(options[0]?.textContent, 'Bold Option');
		assert.equal(options[1]?.textContent, 'Italic Option');
		assert.equal(options[2]?.textContent, 'Plain Option');

		// Check that the rich elements are actually there (on supporting browsers)
		const strong = options[0]?.querySelector('strong');
		const em = options[1]?.querySelector('em');

		// These may or may not exist depending on browser support
		// but the text content should always be correct
		if (strong) {
			assert.equal(strong.textContent, 'Bold');
		}
		if (em) {
			assert.equal(em.textContent, 'Italic');
		}
	}

Domain

Subdomains

Frequently Asked Questions

What does default.test() do?
default.test() is a function in the svelte codebase, defined in packages/svelte/tests/hydration/samples/option-rich-content-static/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/hydration/samples/option-rich-content-static/_config.js at line 18.

Analyze Your Own Codebase

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

Try Supermodel Free