test.ts — svelte Source File
Architecture documentation for test.ts, a typescript file in the svelte codebase. 7 imports, 17 dependents.
Entity Profile
Dependency Diagram
graph LR f83b5d06_5c77_9bd3_2576_7b6b907c4a2f["test.ts"] e97e8c41_1b06_4e9a_29f3_64dbb37dee3c["helpers.js"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> e97e8c41_1b06_4e9a_29f3_64dbb37dee3c 47080410_68df_25ff_dfa2_3d19a537aaa1["try_load_json"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> 47080410_68df_25ff_dfa2_3d19a537aaa1 b2df78f1_f7aa_6fef_0a5c_4dcf959880ff["../suite.js"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> b2df78f1_f7aa_6fef_0a5c_4dcf959880ff f596e027_a951_36c9_7695_83acc4f0d6b9["node:fs"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> f596e027_a951_36c9_7695_83acc4f0d6b9 b63ddb92_634c_990b_eb1b_0bad8a4d434e["vitest"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> b63ddb92_634c_990b_eb1b_0bad8a4d434e a8d49317_f479_a216_78e7_48c9e32499d5["compiler"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> a8d49317_f479_a216_78e7_48c9e32499d5 c696582a_9f3f_d301_2824_cb3de66aa770["#compiler"] f83b5d06_5c77_9bd3_2576_7b6b907c4a2f --> c696582a_9f3f_d301_2824_cb3de66aa770 1ff83637_de19_a7e1_98d2_874e98bec12f["_config.js"] 1ff83637_de19_a7e1_98d2_874e98bec12f --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f 79137fe8_a406_a599_b294_c31c9f4bedb2["_config.js"] 79137fe8_a406_a599_b294_c31c9f4bedb2 --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f e0ec09fe_f4f6_88e8_1d02_2ca1446dbcab["_config.js"] e0ec09fe_f4f6_88e8_1d02_2ca1446dbcab --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f e1a10113_1f8f_a73a_c2d5_085449da7106["_config.js"] e1a10113_1f8f_a73a_c2d5_085449da7106 --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f db893b84_9c9d_7738_8c3c_b06614e0a39f["_config.js"] db893b84_9c9d_7738_8c3c_b06614e0a39f --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f bced0a48_c91a_fd30_b9fc_b151c6d75c77["_config.js"] bced0a48_c91a_fd30_b9fc_b151c6d75c77 --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f 6779696b_4b2f_20a3_f37a_4ef8123643b3["_config.js"] 6779696b_4b2f_20a3_f37a_4ef8123643b3 --> f83b5d06_5c77_9bd3_2576_7b6b907c4a2f style f83b5d06_5c77_9bd3_2576_7b6b907c4a2f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import * as fs from 'node:fs';
import { it, assert } from 'vitest';
import { compile, compileModule } from 'svelte/compiler';
import { try_load_json } from '../helpers.js';
import { suite, type BaseTest } from '../suite.js';
import type { CompileError } from '#compiler';
interface ValidatorTest extends BaseTest {
compileOptions?: Partial<import('#compiler').CompileOptions>;
error?: {
code: string;
message: string;
};
}
/**
* Remove the "https://svelte.dev/e/..." link
*/
function strip_link(message: string) {
return message.slice(0, message.lastIndexOf('\n'));
}
const { test, run } = suite<ValidatorTest>(async (config, cwd) => {
const expected_warnings = try_load_json(`${cwd}/warnings.json`) || [];
const expected_errors = try_load_json(`${cwd}/errors.json`);
const options = try_load_json(`${cwd}/options.json`);
let error;
try {
const module = fs.existsSync(`${cwd}/input.svelte.js`);
const input = (
module
? fs.readFileSync(`${cwd}/input.svelte.js`, 'utf-8')
: fs.readFileSync(`${cwd}/input.svelte`, 'utf-8')
)
.replace(/\s+$/, '')
.replace(/\r/g, '');
const { warnings } = (module ? compileModule : compile)(input, {
...config.compileOptions,
generate: false,
...options
});
assert.deepEqual(
warnings.map((w) => ({
code: w.code,
message: strip_link(w.message),
start: { line: w.start?.line, column: w.start?.column },
end: { line: w.end?.line, column: w.end?.column }
})),
expected_warnings
);
} catch (e) {
error = e as CompileError;
}
const expected = expected_errors && expected_errors[0];
// ... (90 more lines)
Domain
Subdomains
Functions
Types
Dependencies
- #compiler
- ../suite.js
- compiler
- helpers.js
- node:fs
- try_load_json
- vitest
Imported By
- packages/svelte/tests/validator/samples/css-mismatched-quotes/_config.js
- packages/svelte/tests/validator/samples/each-block-multiple-children/_config.js
- packages/svelte/tests/validator/samples/error-mode-warn/_config.js
- packages/svelte/tests/validator/samples/general-siblings-combinator-in-custom-element-selects-slot-fallback/_config.js
- packages/svelte/tests/validator/samples/global-event-reference/_config.js
- packages/svelte/tests/validator/samples/ignore-warning-compiler-option/_config.js
- packages/svelte/tests/validator/samples/no-runes-mode/_config.js
- packages/svelte/tests/validator/samples/non-empty-block-dev/_config.js
- packages/svelte/tests/validator/samples/reactive-statement-non-reactive-self-declaration/_config.js
- packages/svelte/tests/validator/samples/runes-conflicting-store-in-module/_config.js
- packages/svelte/tests/validator/samples/runes-referenced-nonstate/_config.js
- packages/svelte/tests/validator/samples/runes-referenced-nonstate-2/_config.js
- packages/svelte/tests/validator/samples/runes-referenced-nonstate-bind-this/_config.js
- packages/svelte/tests/validator/samples/siblings-combinator-in-custom-element-selects-slot-fallback/_config.js
- packages/svelte/tests/validator/samples/tag-custom-element-options-true/_config.js
- packages/svelte/tests/validator/samples/tag-emoji/_config.js
- packages/svelte/tests/validator/samples/tag-hyphen/_config.js
Source
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): strip_link.
What does test.ts depend on?
test.ts imports 7 module(s): #compiler, ../suite.js, compiler, helpers.js, node:fs, try_load_json, vitest.
What files import test.ts?
test.ts is imported by 17 file(s): _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, _config.js, and 9 more.
Where is test.ts in the architecture?
test.ts is located at packages/svelte/tests/validator/test.ts (domain: BuildSystem, subdomain: MessageProcessor, directory: packages/svelte/tests/validator).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free