Home / File/ _config.js — svelte Source File

_config.js — svelte Source File

Architecture documentation for _config.js, a javascript file in the svelte codebase. 1 imports, 0 dependents.

File javascript BuildSystem QualityControl 1 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  69d2477f_0fc5_d442_5f90_38573e5ff21e["_config.js"]
  241c2922_c732_530f_f92d_772220952a6f["test.ts"]
  69d2477f_0fc5_d442_5f90_38573e5ff21e --> 241c2922_c732_530f_f92d_772220952a6f
  style 69d2477f_0fc5_d442_5f90_38573e5ff21e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { test } from '../../test';

export default test({
	// This test verifies that completely static select with rich option content
	// hydrates correctly and the content is preserved
	snapshot(target) {
		const select = target.querySelector('select');
		const options = target.querySelectorAll('option');

		return {
			select,
			option1: options[0],
			option2: options[1],
			option3: options[2]
		};
	},

	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

Dependencies

Frequently Asked Questions

What does _config.js do?
_config.js is a source file in the svelte codebase, written in javascript. It belongs to the BuildSystem domain, QualityControl subdomain.
What functions are defined in _config.js?
_config.js defines 2 function(s): default.snapshot, default.test.
What does _config.js depend on?
_config.js imports 1 module(s): test.ts.
Where is _config.js in the architecture?
_config.js is located at packages/svelte/tests/hydration/samples/option-rich-content-static/_config.js (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/tests/hydration/samples/option-rich-content-static).

Analyze Your Own Codebase

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

Try Supermodel Free