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

Relationship Graph

Source Code

packages/svelte/tests/runtime-legacy/samples/raw-anchor-first-last-child/_config.js lines 8–21

	test({ assert, component, target, variant }) {
		const span = target.querySelector('span');
		ok(span);
		if (variant === 'dom') {
			assert.ok(!span.previousSibling);
		} else {
			// hydration: previous is the ssr comment
			assert.ok(!span.previousSibling?.previousSibling);
		}
		// next is the anchor
		assert.ok(!span.nextSibling?.nextSibling);

		component.raw = '<span>bar</span>';
	}

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/raw-anchor-first-last-child/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/raw-anchor-first-last-child/_config.js at line 8.

Analyze Your Own Codebase

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

Try Supermodel Free