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

Relationship Graph

Source Code

packages/svelte/tests/runtime-legacy/samples/component-svelte-fragment-let-destructured-2/_config.js lines 19–82

	test({ assert, target, window }) {
		const [button1, button2, button3] = target.querySelectorAll('button');
		const event = new window.MouseEvent('click', { bubbles: true });

		button1.dispatchEvent(event);
		flushSync();
		assert.htmlEqual(
			target.innerHTML,
			`
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 0 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 0 hello
				<button>Increment</button>
			</div>
		`
		);

		button2.dispatchEvent(event);
		flushSync();
		assert.htmlEqual(
			target.innerHTML,
			`
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 0 hello
				<button>Increment</button>
			</div>
		`
		);

		button3.dispatchEvent(event);
		flushSync();
		assert.htmlEqual(
			target.innerHTML,
			`
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
			<div>
				hello world 1 hello
				<button>Increment</button>
			</div>
		`
		);
	}

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/component-svelte-fragment-let-destructured-2/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/runtime-legacy/samples/component-svelte-fragment-let-destructured-2/_config.js at line 19.

Analyze Your Own Codebase

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

Try Supermodel Free