Skip to content

Commit 1596663

Browse files
authored
chore(wtr): update files @W-19097558 (#5468)
* test(wtr): clear <head> and clear global stylesheets when needed * test(wtr): mock LWC to validate sanitizeAttribute We can't mock individual methods of ESM modules in the browser, so we use WTR's import map plugin to redirect all "lwc" imports to a mock file. The mock file is mostly a re-export. * chore(deps): bump @types/jasmine * chore(wtr): convert package to module * chore(wtr): copy files instead of using symlinks
1 parent 98a949c commit 1596663

File tree

3,162 files changed

+57305
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,162 files changed

+57305
-25
lines changed

packages/@lwc/integration-not-karma/configs/base.mjs renamed to packages/@lwc/integration-not-karma/configs/base.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { join } from 'node:path';
22
import { LWC_VERSION } from '@lwc/shared';
33
import { importMapsPlugin } from '@web/dev-server-import-maps';
4-
import * as options from '../helpers/options.mjs';
4+
import * as options from '../helpers/options.js';
55

66
const pluck = (obj, keys) => Object.fromEntries(keys.map((k) => [k, obj[k]]));
77
const maybeImport = (file, condition) => (condition ? `await import('${file}');` : '');
@@ -29,14 +29,15 @@ export default {
2929
// time out before they receive focus. But it also makes the full suite take 3x longer to run...
3030
// Potential workaround: https://github.com/modernweb-dev/web/issues/2588
3131
concurrency: 1,
32+
filterBrowserLogs: () => false,
3233
nodeResolve: true,
3334
rootDir: join(import.meta.dirname, '..'),
3435
plugins: [
35-
importMapsPlugin({ inject: { importMap: { imports: { lwc: './mocks/lwc.mjs' } } } }),
36+
importMapsPlugin({ inject: { importMap: { imports: { lwc: './mocks/lwc.js' } } } }),
3637
{
3738
resolveImport({ source }) {
3839
if (source === 'test-utils') {
39-
return '/helpers/utils.mjs';
40+
return '/helpers/utils.js';
4041
} else if (source === 'wire-service') {
4142
// To serve files outside the web root (e.g. node_modules in the monorepo root),
4243
// @web/dev-server provides this "magic" path. It's hacky of us to use it directly.
@@ -66,7 +67,7 @@ export default {
6667
${maybeImport('@lwc/synthetic-shadow', !options.DISABLE_SYNTHETIC)}
6768
${maybeImport('@lwc/aria-reflection', options.ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL)}
6869
</script>
69-
<script type="module" src="./helpers/setup.mjs"></script>
70+
<script type="module" src="./helpers/setup.js"></script>
7071
<script type="module" src="${testFramework}"></script>
7172
</head>
7273
</html>`,

packages/@lwc/integration-not-karma/configs/hydration.mjs renamed to packages/@lwc/integration-not-karma/configs/hydration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Use native shadow by default in hydration tests; MUST be set before imports
22
process.env.DISABLE_SYNTHETIC ??= 'true';
3-
import baseConfig from './base.mjs';
4-
import hydrationTestPlugin from './plugins/serve-hydration.mjs';
3+
import baseConfig from './base.js';
4+
import hydrationTestPlugin from './plugins/serve-hydration.js';
55

66
/** @type {import("@web/test-runner").TestRunnerConfig} */
77
export default {

packages/@lwc/integration-not-karma/configs/integration.mjs renamed to packages/@lwc/integration-not-karma/configs/integration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import baseConfig from './base.mjs';
2-
import testPlugin from './plugins/serve-integration.mjs';
1+
import baseConfig from './base.js';
2+
import testPlugin from './plugins/serve-integration.js';
33

44
/** @type {import("@web/test-runner").TestRunnerConfig} */
55
export default {

packages/@lwc/integration-not-karma/configs/plugins/serve-hydration.mjs renamed to packages/@lwc/integration-not-karma/configs/plugins/serve-hydration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import vm from 'node:vm';
33
import fs from 'node:fs/promises';
44
import { rollup } from 'rollup';
55
import lwcRollupPlugin from '@lwc/rollup-plugin';
6-
import { DISABLE_STATIC_CONTENT_OPTIMIZATION, ENGINE_SERVER } from '../../helpers/options.mjs';
6+
import { DISABLE_STATIC_CONTENT_OPTIMIZATION, ENGINE_SERVER } from '../../helpers/options.js';
77
const lwcSsr = await (ENGINE_SERVER ? import('@lwc/engine-server') : import('@lwc/ssr-runtime'));
88

99
const ROOT_DIR = path.join(import.meta.dirname, '../..');

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
COVERAGE,
88
DISABLE_STATIC_CONTENT_OPTIMIZATION,
99
DISABLE_SYNTHETIC_SHADOW_SUPPORT_IN_COMPILER,
10-
} from '../../helpers/options.mjs';
10+
} from '../../helpers/options.js';
1111

1212
/** Cache reused between each compilation to speed up the compilation time. */
1313
let cache;
File renamed without changes.

packages/@lwc/integration-not-karma/helpers/console.mjs renamed to packages/@lwc/integration-not-karma/helpers/console.js

File renamed without changes.

packages/@lwc/integration-not-karma/helpers/constants.mjs renamed to packages/@lwc/integration-not-karma/helpers/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { API_VERSION } from './options.mjs';
1+
import { API_VERSION } from './options.js';
22

33
// These values are based on the API versions in @lwc/shared/api-version
44
export const LOWERCASE_SCOPE_TOKENS = API_VERSION >= 59,
File renamed without changes.

packages/@lwc/integration-not-karma/helpers/matchers/console.mjs renamed to packages/@lwc/integration-not-karma/helpers/matchers/console.js

File renamed without changes.

0 commit comments

Comments
 (0)