Home / File/ test.ts — svelte Source File

test.ts — svelte Source File

Architecture documentation for test.ts, a typescript file in the svelte codebase. 7 imports, 28 dependents.

File typescript BuildSystem MessageProcessor 7 imports 28 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  032186a9_8a8b_b603_4335_6ade22d767cb["test.ts"]
  b2df78f1_f7aa_6fef_0a5c_4dcf959880ff["../suite.js"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> b2df78f1_f7aa_6fef_0a5c_4dcf959880ff
  e97e8c41_1b06_4e9a_29f3_64dbb37dee3c["helpers.js"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> e97e8c41_1b06_4e9a_29f3_64dbb37dee3c
  40a894df_04e7_906d_8c12_9e2e7b588e57["compile_directory"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> 40a894df_04e7_906d_8c12_9e2e7b588e57
  f596e027_a951_36c9_7695_83acc4f0d6b9["node:fs"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> f596e027_a951_36c9_7695_83acc4f0d6b9
  b63ddb92_634c_990b_eb1b_0bad8a4d434e["vitest"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> b63ddb92_634c_990b_eb1b_0bad8a4d434e
  5415ae33_acc7_39bf_2a56_bf3800623713["locate-character"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> 5415ae33_acc7_39bf_2a56_bf3800623713
  10d5cc0f_edd6_3617_3c00_d2efb24fb338["sourcemap-codec"]
  032186a9_8a8b_b603_4335_6ade22d767cb --> 10d5cc0f_edd6_3617_3c00_d2efb24fb338
  9b44e71a_66ae_4baf_57a9_5cd698aa8602["_config.js"]
  9b44e71a_66ae_4baf_57a9_5cd698aa8602 --> 032186a9_8a8b_b603_4335_6ade22d767cb
  5127b0e8_b7df_eb34_0fe4_8cfda57d7cad["_config.js"]
  5127b0e8_b7df_eb34_0fe4_8cfda57d7cad --> 032186a9_8a8b_b603_4335_6ade22d767cb
  27683dbc_0900_7145_8f52_920892facc3e["_config.js"]
  27683dbc_0900_7145_8f52_920892facc3e --> 032186a9_8a8b_b603_4335_6ade22d767cb
  fb4eb4f0_da18_2610_0df6_ccceda07c1d0["_config.js"]
  fb4eb4f0_da18_2610_0df6_ccceda07c1d0 --> 032186a9_8a8b_b603_4335_6ade22d767cb
  13ba6e0d_7339_6885_173d_f039282b25e5["_config.js"]
  13ba6e0d_7339_6885_173d_f039282b25e5 --> 032186a9_8a8b_b603_4335_6ade22d767cb
  cd8a45ab_4236_5f51_36bb_5a4a0f57c0da["_config.js"]
  cd8a45ab_4236_5f51_36bb_5a4a0f57c0da --> 032186a9_8a8b_b603_4335_6ade22d767cb
  d3afbd21_c868_5dcf_9410_cf4749b711bc["_config.js"]
  d3afbd21_c868_5dcf_9410_cf4749b711bc --> 032186a9_8a8b_b603_4335_6ade22d767cb
  style 032186a9_8a8b_b603_4335_6ade22d767cb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as fs from 'node:fs';
import { assert } from 'vitest';
import { getLocator, locate } from 'locate-character';
import { suite, type BaseTest } from '../suite.js';
import { compile_directory } from '../helpers.js';
import { decode } from '@jridgewell/sourcemap-codec';

type SourceMapEntry =
	| string
	| {
			/** If not the first occurrence, but the nth should be found */
			idxOriginal?: number;
			/** If not the first occurrence, but the nth should be found */
			idxGenerated?: number;
			/** The original string to find */
			str: string;
			/** The generated string to find. You can omit this if it's the same as the original string */
			strGenerated?: string | null;
			/** If the original code lives in a different file, pass its source code here */
			code?: string;
	  };

interface SourcemapTest extends BaseTest {
	options?: { filename: string };
	compileOptions?: Partial<import('#compiler').CompileOptions>;
	preprocess?:
		| import('../../src/compiler/public').PreprocessorGroup
		| import('../../src/compiler/public').PreprocessorGroup[];
	/** The expected `sources` array in the source map */
	js_map_sources?: string[];
	/** The expected `sources` array in the source map */
	css_map_sources?: string[];
	test?: (obj: {
		assert: typeof assert;
		input: string;
		map_preprocessed: any;
		code_preprocessed: string;
		map_css: any;
		code_css: string;
		map_client: any;
		code_client: string;
	}) => void;
	/** Mappings to check in generated client code */
	client?: SourceMapEntry[] | null;
	/** Mappings to check in generated server code. If left out, will use the client code checks */
	server?: SourceMapEntry[];
	/** Mappings to check in generated css code */
	css?: SourceMapEntry[] | null;
	/** Mappings to check in preprocessed Svelte code */
	preprocessed?: SourceMapEntry[];
}

const { test, run } = suite<SourcemapTest>(async (config, cwd) => {
	await compile_directory(cwd, 'client', config.compileOptions, true, {
		preprocess: config.preprocess,
		options: config.options
	});
	await compile_directory(cwd, 'server', config.compileOptions, true, {
		preprocess: config.preprocess,
		options: config.options
// ... (241 more lines)

Domain

Subdomains

Functions

Dependencies

Imported By

Frequently Asked Questions

What does test.ts do?
test.ts is a source file in the svelte codebase, written in typescript. It belongs to the BuildSystem domain, MessageProcessor subdomain.
What functions are defined in test.ts?
test.ts defines 1 function(s): obj.
What does test.ts depend on?
test.ts imports 7 module(s): ../suite.js, compile_directory, helpers.js, locate-character, node:fs, sourcemap-codec, vitest.
What files import test.ts?
test.ts is imported by 28 file(s): _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, and 20 more.
Where is test.ts in the architecture?
test.ts is located at packages/svelte/tests/sourcemaps/test.ts (domain: BuildSystem, subdomain: MessageProcessor, directory: packages/svelte/tests/sourcemaps).

Analyze Your Own Codebase

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

Try Supermodel Free