Skip to content

Commit 55fe0db

Browse files
committed
test(wtr): configure tests to use relative file for utils
instead of weird fake module
1 parent db6ab44 commit 55fe0db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/@lwc/integration-not-karma/configs/plugins/serve-integration.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'node:path';
2+
import { fileURLToPath } from 'node:url';
23
import { rollup } from 'rollup';
34
import lwcRollupPlugin from '@lwc/rollup-plugin';
45

@@ -9,6 +10,8 @@ import {
910
DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER,
1011
} from '../../helpers/options.js';
1112

13+
const UTILS = fileURLToPath(new URL('../../helpers/utils.js', import.meta.url));
14+
1215
/** Cache reused between each compilation to speed up the compilation time. */
1316
let cache;
1417

@@ -22,7 +25,7 @@ const createRollupPlugin = (input, options) => {
2225
// Sourcemaps don't work with Istanbul coverage
2326
sourcemap: !process.env.COVERAGE,
2427
experimentalDynamicComponent: {
25-
loader: 'test-utils',
28+
loader: UTILS,
2629
strict: true,
2730
},
2831
enableDynamicComponents: true,
@@ -85,7 +88,7 @@ const transform = async (ctx) => {
8588

8689
// Rollup should not attempt to resolve the engine and the test utils, Karma takes care of injecting it
8790
// globally in the page before running the tests.
88-
external: ['lwc', 'wire-service', 'test-utils', '@test/loader'],
91+
external: ['lwc', 'wire-service', '@test/loader', UTILS],
8992

9093
onwarn(warning, warn) {
9194
// Ignore warnings from our own Rollup plugin

0 commit comments

Comments
 (0)