test.ts — svelte Source File
Architecture documentation for test.ts, a typescript file in the svelte codebase. 31 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 4469324d_0988_ea58_7534_0c58bd171620["test.ts"] 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2["index-client.js"] 4469324d_0988_ea58_7534_0c58bd171620 --> 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2 bde4209f_8ffc_1594_4024_b1835a44bcf6["runtime.js"] 4469324d_0988_ea58_7534_0c58bd171620 --> bde4209f_8ffc_1594_4024_b1835a44bcf6 48cf26f8_bf34_fd7a_3d52_cc963051e167["context.js"] 4469324d_0988_ea58_7534_0c58bd171620 --> 48cf26f8_bf34_fd7a_3d52_cc963051e167 ea5280ff_3b87_42ee_3823_3570b76a5779["push"] 4469324d_0988_ea58_7534_0c58bd171620 --> ea5280ff_3b87_42ee_3823_3570b76a5779 7114b424_5006_2886_1565_8d8123ef1ad8["pop"] 4469324d_0988_ea58_7534_0c58bd171620 --> 7114b424_5006_2886_1565_8d8123ef1ad8 1ae6fa4e_16ee_acdf_5e28_17eb0819fddb["effects.js"] 4469324d_0988_ea58_7534_0c58bd171620 --> 1ae6fa4e_16ee_acdf_5e28_17eb0819fddb a985ae40_8ef8_7ef2_adad_116fbf97e70c["effect"] 4469324d_0988_ea58_7534_0c58bd171620 --> a985ae40_8ef8_7ef2_adad_116fbf97e70c cf74814c_38ff_1817_80eb_cbc1bb490472["effect_root"] 4469324d_0988_ea58_7534_0c58bd171620 --> cf74814c_38ff_1817_80eb_cbc1bb490472 7494b934_a3b8_689e_91b6_8435e26461c5["render_effect"] 4469324d_0988_ea58_7534_0c58bd171620 --> 7494b934_a3b8_689e_91b6_8435e26461c5 61387353_b966_b4f7_d65e_52c75ac7ff61["user_effect"] 4469324d_0988_ea58_7534_0c58bd171620 --> 61387353_b966_b4f7_d65e_52c75ac7ff61 b4142a92_fb70_a0da_ca48_719b2f2398ad["user_pre_effect"] 4469324d_0988_ea58_7534_0c58bd171620 --> b4142a92_fb70_a0da_ca48_719b2f2398ad e5c35d51_28d8_9054_923d_b7f82a3c8dc2["sources.js"] 4469324d_0988_ea58_7534_0c58bd171620 --> e5c35d51_28d8_9054_923d_b7f82a3c8dc2 39208392_58c1_7201_b748_aa74d97cadb9["state"] 4469324d_0988_ea58_7534_0c58bd171620 --> 39208392_58c1_7201_b748_aa74d97cadb9 63ee8247_ada4_9f1d_e139_0c1167cd5b1c["set"] 4469324d_0988_ea58_7534_0c58bd171620 --> 63ee8247_ada4_9f1d_e139_0c1167cd5b1c style 4469324d_0988_ea58_7534_0c58bd171620 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { describe, assert, it } from 'vitest';
import { flushSync } from '../../src/index-client';
import * as $ from '../../src/internal/client/runtime';
import { push, pop } from '../../src/internal/client/context';
import {
effect,
effect_root,
render_effect,
user_effect,
user_pre_effect
} from '../../src/internal/client/reactivity/effects';
import { state, set, update, update_pre } from '../../src/internal/client/reactivity/sources';
import type { Derived, Effect, Source, Value } from '../../src/internal/client/types';
import { proxy } from '../../src/internal/client/proxy';
import { derived } from '../../src/internal/client/reactivity/deriveds';
import { snapshot } from '../../src/internal/shared/clone.js';
import { SvelteSet } from '../../src/reactivity/set';
import { DESTROYED } from '../../src/internal/client/constants';
import { noop } from 'svelte/internal/client';
import { disable_async_mode_flag, enable_async_mode_flag } from '../../src/internal/flags';
/**
* @param runes runes mode
* @param fn A function that returns a function because we first need to set up all the signals
* and then execute the test in order to simulate a real component
*/
function run_test(runes: boolean, fn: (runes: boolean) => () => void) {
return () => {
// Create a component context to test runes vs legacy mode
push({}, runes);
// Create a render context so that effect validations etc don't fail
let execute: any;
const destroy = effect_root(() => {
execute = fn(runes);
});
pop();
execute();
destroy();
};
}
function test(text: string, fn: (runes: boolean) => any) {
it(`${text} (legacy mode)`, run_test(false, fn));
it(`${text} (runes mode)`, run_test(true, fn));
}
test.only = (text: string, fn: (runes: boolean) => any) => {
it.only(`${text} (legacy mode)`, run_test(false, fn));
it.only(`${text} (runes mode)`, run_test(true, fn));
};
test.skip = (text: string, fn: (runes: boolean) => any) => {
it.skip(`${text} (legacy mode)`, run_test(false, fn));
it.skip(`${text} (runes mode)`, run_test(true, fn));
};
describe('signals', () => {
test('effect with state and derived in it', () => {
const log: string[] = [];
// ... (1437 more lines)
Domain
Subdomains
Functions
Classes
Dependencies
- ../../src/internal/client/types
- SvelteSet
- client
- clone.js
- constants.js
- context.js
- derived
- deriveds.js
- disable_async_mode_flag
- effect
- effect_root
- effects.js
- enable_async_mode_flag
- index-client.js
- index.js
- pop
- proxy
- proxy.js
- push
- render_effect
- runtime.js
- set
- set.js
- snapshot
- sources.js
- state
- update
- update_pre
- user_effect
- user_pre_effect
- vitest
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, QualityControl subdomain.
What functions are defined in test.ts?
test.ts defines 2 function(s): run_test, test.
What does test.ts depend on?
test.ts imports 31 module(s): ../../src/internal/client/types, SvelteSet, client, clone.js, constants.js, context.js, derived, deriveds.js, and 23 more.
Where is test.ts in the architecture?
test.ts is located at packages/svelte/tests/signals/test.ts (domain: BuildSystem, subdomain: QualityControl, directory: packages/svelte/tests/signals).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free