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
  5199ae17_f544_57d6_053d_a6f976298800["_config.js"]
  654af6d6_2570_6860_f8dd_6b6131e1eec4["test.ts"]
  5199ae17_f544_57d6_053d_a6f976298800 --> 654af6d6_2570_6860_f8dd_6b6131e1eec4
  style 5199ae17_f544_57d6_053d_a6f976298800 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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

export default test({
	get props() {
		return {
			things: [
				{ id: 1, name: 'a' },
				{ id: 2, name: 'b' },
				{ id: 3, name: 'c' },
				{ id: 4, name: 'd' },
				{ id: 5, name: 'e' }
			]
		};
	},

	html: `
		<div>a</div>
		<div>b</div>
		<div>c</div>
		<div>d</div>
		<div>e</div>
	`,

	test({ assert, component, target, raf }) {
		let divs = target.querySelectorAll('div');
		divs.forEach((div) => {
			// @ts-expect-error
			div.getBoundingClientRect = function () {
				// @ts-expect-error
				const index = [...this.parentNode.children].indexOf(this);
				const top = index * 30;

				return {
					left: 0,
					right: 100,
					top,
					bottom: top + 20
				};
			};
		});

		component.things = [
			{ id: 5, name: 'e' },
			{ id: 2, name: 'b' },
			{ id: 3, name: 'c' },
			{ id: 4, name: 'd' },
			{ id: 1, name: 'a' }
		];

		raf.tick(0);

		divs = target.querySelectorAll('div');
		assert.ok(divs[0].getAnimations().length > 0);
		assert.equal(divs[1].getAnimations().length, 0);
		assert.equal(divs[2].getAnimations().length, 0);
		assert.equal(divs[3].getAnimations().length, 0);
		assert.ok(divs[4].getAnimations().length > 0);

		raf.tick(100);
		assert.deepEqual([divs[0].getAnimations().length, divs[4].getAnimations().length], [0, 0]);
	}
});

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.props, 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/animation-css/_config.js (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/tests/runtime-legacy/samples/animation-css).

Analyze Your Own Codebase

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

Try Supermodel Free