MCPcopy
hub / github.com/sveltejs/svelte / runtime_suite

Function runtime_suite

packages/svelte/tests/runtime-legacy/shared.ts:175–239  ·  view source on GitHub ↗
(runes: boolean)

Source from the content-addressed store, hash-verified

173let console_error = console.error;
174
175export function runtime_suite(runes: boolean) {
176 return suite_with_variants<RuntimeTest, 'hydrate' | 'ssr' | 'async-ssr' | 'dom', CompileOptions>(
177 ['dom', 'hydrate', 'ssr', 'async-ssr'],
178 (variant, config, test_name) => {
179 if (!async_mode && (config.skip_no_async || test_name.startsWith('async-'))) {
180 return true;
181 }
182
183 if (async_mode && config.skip_async) {
184 return true;
185 }
186
187 if (variant === 'hydrate') {
188 if (config.mode && !config.mode.includes('hydrate')) return 'no-test';
189 if (config.skip_mode?.includes('hydrate')) return true;
190 }
191
192 if (
193 variant === 'dom' &&
194 (config.skip_mode?.includes('client') || (config.mode && !config.mode.includes('client')))
195 ) {
196 return 'no-test';
197 }
198
199 if (variant === 'ssr') {
200 if (
201 (config.mode && !config.mode.includes('server')) ||
202 (!config.test_ssr &&
203 config.html === undefined &&
204 config.ssrHtml === undefined &&
205 config.error === undefined &&
206 config.runtime_error === undefined &&
207 !config.mode?.includes('server'))
208 ) {
209 return 'no-test';
210 }
211 if (config.skip_mode?.includes('server')) return true;
212 }
213
214 if (variant === 'async-ssr') {
215 if (!runes || !async_mode) return 'no-test';
216 if (
217 (config.mode && !config.mode.includes('async-server')) ||
218 (!config.test_ssr &&
219 config.html === undefined &&
220 config.ssrHtml === undefined &&
221 config.error === undefined &&
222 config.runtime_error === undefined &&
223 !config.mode?.includes('async-server'))
224 ) {
225 return 'no-test';
226 }
227 if (config.skip_mode?.includes('async-server')) return true;
228 }
229
230 return false;
231 },
232 (config, cwd) => {

Callers 4

test.tsFile · 0.90
test.tsFile · 0.90
test.tsFile · 0.90
test.tsFile · 0.85

Calls 3

suite_with_variantsFunction · 0.85
common_setupFunction · 0.85
run_test_variantFunction · 0.85

Tested by

no test coverage detected