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

Relationship Graph

Source Code

packages/svelte/tests/runtime-legacy/samples/binding-input-text-deep-computed/_config.js lines 19–51

	test({ assert, component, target, window }) {
		const input = target.querySelector('input');
		ok(input);

		assert.equal(input.value, 'alice');

		const event = new window.Event('input');

		input.value = 'bob';
		input.dispatchEvent(event);
		flushSync();

		assert.htmlEqual(
			target.innerHTML,
			`
			<input>
			<p>hello bob</p>
		`
		);

		const user = component.user;
		user.name = 'carol';

		component.user = user;
		assert.equal(input.value, 'carol');
		assert.htmlEqual(
			target.innerHTML,
			`
			<input>
			<p>hello carol</p>
		`
		);
	}

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