Skip to content

Commit 3e31a4d

Browse files
wjhsfjhefferman-sfdc
authored andcommitted
chore: don't use custom test timeout for fixtures (#5221)
1 parent 50516ed commit 3e31a4d

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

packages/@lwc/engine-server/src/__tests__/fixtures.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ interface FixtureModule {
2222
features?: any[];
2323
}
2424

25-
vi.setConfig({ testTimeout: 10_000 /* 10 seconds */ });
26-
2725
vi.mock('lwc', async () => {
2826
const lwcEngineServer = await import('../index');
2927
try {

packages/@lwc/engine-server/src/__tests__/html-serialization.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import path from 'node:path';
99
import vm from 'node:vm';
10-
import { vi, describe, it, expect } from 'vitest';
10+
import { describe, it, expect } from 'vitest';
1111
import { parseFragment, serialize } from 'parse5';
1212
import { rollup } from 'rollup';
1313
import replace from '@rollup/plugin-replace';
@@ -22,8 +22,6 @@ import type { RollupLog } from 'rollup';
2222
* robust than snapshots, which may have invalid/incorrect HTML.
2323
*/
2424

25-
vi.setConfig({ testTimeout: 10_000 /* 10 seconds */ });
26-
2725
// Compile a component to an HTML string, using the full LWC compilation pipeline
2826
async function compileComponent(tagName: string, componentName: string) {
2927
const modulesDir = path.resolve(__dirname, './modules');

packages/@lwc/ssr-compiler/src/__tests__/fixtures.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ interface FixtureModule {
2222
features?: FeatureFlagName[];
2323
}
2424

25-
vi.setConfig({ testTimeout: 10_000 /* 10 seconds */ });
26-
2725
vi.mock('@lwc/ssr-runtime', async () => {
2826
const runtime = await import('@lwc/ssr-runtime');
2927
try {

vitest.shared.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import pkg from './package.json';
55
export default defineConfig({
66
test: {
77
// Don't time out if we detect a debugger attached
8-
testTimeout: inspector.url() ? 2147483647 : undefined,
8+
testTimeout: inspector.url()
9+
? // Largest allowed delay, see https://developer.mozilla.org/en-US/docs/Web/API/Window/setTimeout#maximum_delay_value
10+
2147483647
11+
: undefined,
912
include: ['**/*.{test,spec}.{mjs,js,ts}'],
1013
snapshotFormat: {
1114
printBasicPrototype: true,

0 commit comments

Comments
 (0)