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

Relationship Graph

Source Code

packages/svelte/tests/hydration/samples/raw-mismatch-static/_config.js lines 4–10

	test(assert, target) {
		// This test case guards against a potential future bug where we could optimize html tags away for static content:
		// Even if the {@html } block seems static, it should be preserved as such, because it could be dynamic originally
		// (like {@html browser ? 'foo' : 'bar'} which is then different between client and server.
		// Also see https://github.com/sveltejs/svelte/issues/8683 where this happened for Svelte 4.
		assert.htmlEqual(target.innerHTML, 'Server');
	},

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/raw-mismatch-static/_config.js.
Where is default.test() defined?
default.test() is defined in packages/svelte/tests/hydration/samples/raw-mismatch-static/_config.js at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free