Home / File/ _config.js — svelte Source File

_config.js — svelte Source File

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

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: '',

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

		return deferred.promise
			.then(() => {
				assert.htmlEqual(
					target.innerHTML,
					`
					<p>the value is 42</p>
				`
				);

				deferred = create_deferred();

				component.thePromise = deferred.promise;

				assert.htmlEqual(target.innerHTML, '');

				deferred.reject(new Error('something broke'));

				return deferred.promise.catch(() => {});
			})
			.then(() => {
				assert.htmlEqual(
					target.innerHTML,
					`
					<p>oh no! something broke</p>
				`
				);
			});
	}
});

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 3 module(s): create_deferred, helpers.js, test.ts.
Where is _config.js in the architecture?
_config.js is located at packages/svelte/tests/runtime-legacy/samples/await-then-shorthand/_config.js (domain: BuildSystem, subdomain: MessageProcessor, directory: packages/svelte/tests/runtime-legacy/samples/await-then-shorthand).

Analyze Your Own Codebase

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

Try Supermodel Free