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.

Entity Profile

Dependency Diagram

graph LR
  f451ccf3_50c6_5925_721d_bdf49c9c7e53["_config.js"]
  654af6d6_2570_6860_f8dd_6b6131e1eec4["test.ts"]
  f451ccf3_50c6_5925_721d_bdf49c9c7e53 --> 654af6d6_2570_6860_f8dd_6b6131e1eec4
  style f451ccf3_50c6_5925_721d_bdf49c9c7e53 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

export default test({
	withoutNormalizeHtml: true,
	// Unable to test `html` with `<textarea>` content
	// as the textarea#value will not show within `innerHtml`
	ssrHtml: `<!--[--><textarea id="textarea">  A
  B
</textarea> <div id="div-with-textarea"><textarea>    A
    B
  </textarea></div> <div id="textarea-with-leading-newline"><textarea>leading newline</textarea> <textarea>  leading newline and spaces</textarea> <textarea>
leading newlines</textarea></div> <div id="textarea-without-leading-newline"><textarea>without spaces</textarea> <textarea>  with spaces  </textarea> <textarea>${' '}
newline after leading space</textarea></div> <textarea id="textarea-with-multiple-leading-newlines">

multiple leading newlines</textarea> <div id="div-with-textarea-with-multiple-leading-newlines"><textarea>

multiple leading newlines</textarea></div><!--]-->`,
	test({ assert, target }) {
		// Test for <textarea> tag
		const elementTextarea = /** @type {HTMLTextAreaElement} */ (target.querySelector('#textarea'));
		// Test for <textarea> tag in non <textarea> tag
		const elementDivWithTextarea = /** @type {HTMLDivElement} */ (
			target.querySelector('#div-with-textarea')
		);
		// Test for <textarea> tag with leading newline
		const elementTextareaWithLeadingNewline = target.querySelector(
			'#textarea-with-leading-newline'
		);
		const elementTextareaWithoutLeadingNewline = target.querySelector(
			'#textarea-without-leading-newline'
		);
		const elementTextareaWithMultipleLeadingNewline = target.querySelector(
			'#textarea-with-multiple-leading-newlines'
		);
		const elementDivWithTextareaWithMultipleLeadingNewline = target.querySelector(
			'#div-with-textarea-with-multiple-leading-newlines'
		);

		ok(elementTextareaWithLeadingNewline);
		ok(elementTextareaWithoutLeadingNewline);
		ok(elementTextareaWithMultipleLeadingNewline);
		ok(elementDivWithTextareaWithMultipleLeadingNewline);

		assert.equal(
			elementTextarea.value,
			`  A
  B
`
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementDivWithTextarea.children[0]).value,
			`    A
    B
  `
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithLeadingNewline.children[0]).value,
			'leading newline'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithLeadingNewline.children[1]).value,
			'  leading newline and spaces'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithLeadingNewline.children[2]).value,
			'\nleading newlines'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithoutLeadingNewline.children[0]).value,
			'without spaces'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithoutLeadingNewline.children[1]).value,
			'  with spaces  '
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithoutLeadingNewline.children[2]).value,
			' \nnewline after leading space'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (elementTextareaWithMultipleLeadingNewline).value,
			'\n\nmultiple leading newlines'
		);
		assert.equal(
			/** @type {HTMLTextAreaElement} */ (
				elementDivWithTextareaWithMultipleLeadingNewline.children[0]
			).value,
			'\n\nmultiple leading newlines'
		);
	}
});

Domain

Subdomains

Functions

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, MessageProcessor subdomain.
What functions are defined in _config.js?
_config.js defines 1 function(s): 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/runtime-legacy/samples/textarea-content/_config.js (domain: BuildSystem, subdomain: MessageProcessor, directory: packages/svelte/tests/runtime-legacy/samples/textarea-content).

Analyze Your Own Codebase

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

Try Supermodel Free