Home / File/ _config.js — svelte Source File

_config.js — svelte Source File

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

Entity Profile

Dependency Diagram

graph LR
  a7c8543b_e224_c14c_2c49_f5bcf8706e78["_config.js"]
  654af6d6_2570_6860_f8dd_6b6131e1eec4["test.ts"]
  a7c8543b_e224_c14c_2c49_f5bcf8706e78 --> 654af6d6_2570_6860_f8dd_6b6131e1eec4
  e97e8c41_1b06_4e9a_29f3_64dbb37dee3c["helpers.js"]
  a7c8543b_e224_c14c_2c49_f5bcf8706e78 --> e97e8c41_1b06_4e9a_29f3_64dbb37dee3c
  968bf0f0_2e69_28c9_a363_08177fdb8e17["create_deferred"]
  a7c8543b_e224_c14c_2c49_f5bcf8706e78 --> 968bf0f0_2e69_28c9_a363_08177fdb8e17
  4ead6623_c53e_ab40_5690_64903d5addf1["svelte"]
  a7c8543b_e224_c14c_2c49_f5bcf8706e78 --> 4ead6623_c53e_ab40_5690_64903d5addf1
  style a7c8543b_e224_c14c_2c49_f5bcf8706e78 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { tick } from 'svelte';
import { test } from '../../test';
import { create_deferred } from '../../../helpers.js';

/** @type {ReturnType<typeof create_deferred>} */
let deferred;

export default test({
	before_test() {
		deferred = create_deferred();
	},
	get props() {
		return {
			thePromise: deferred.promise
		};
	},

	html: `
		<p>loading...</p>
	`,

	test({ assert, component, target, window }) {
		deferred.resolve(42);

		return deferred.promise
			.then(async () => {
				await tick();
				assert.htmlEqual(target.innerHTML, '<button>click me</button>');

				const { button } = component;

				const click = new window.Event('click', { bubbles: true });
				button.dispatchEvent(click);

				assert.equal(component.clicked, 42);

				const thePromise = Promise.resolve(43);
				component.thePromise = thePromise;

				return thePromise;
			})
			.then(() => {
				const { button } = component;

				const click = new window.Event('click', { bubbles: true });
				button.dispatchEvent(click);

				assert.equal(component.clicked, 43);
			});
	}
});

Domain

Subdomains

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 3 function(s): default.before_test, default.props, default.test.
What does _config.js depend on?
_config.js imports 4 module(s): create_deferred, helpers.js, svelte, test.ts.
Where is _config.js in the architecture?
_config.js is located at packages/svelte/tests/runtime-legacy/samples/await-then-catch-event/_config.js (domain: BuildSystem, subdomain: MessageProcessor, directory: packages/svelte/tests/runtime-legacy/samples/await-then-catch-event).

Analyze Your Own Codebase

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

Try Supermodel Free