Skip to content
Merged
Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
8c7ed79
test(wtr): update tests to use relative path to utils
wjhsf Aug 28, 2025
e2f88d5
test(wtr): revert removing TestUtils
wjhsf Sep 2, 2025
81275d0
test(wtr): remove useless describe
wjhsf Sep 2, 2025
39533d3
test(wtr): replace IIFE script with module import
wjhsf Sep 2, 2025
33e58c8
test(wtr): clean up SSR execution script
wjhsf Sep 2, 2025
d0b8003
test(wtr): always use DISABLE_SYNTHETIC
wjhsf Sep 3, 2025
976c002
test(wtr): enable all hydration tests
wjhsf Sep 3, 2025
8d39505
Merge branch 'master' into wjh/wtr-hyd
wjhsf Sep 4, 2025
c66afad
test(wtr): remove side effect from signals helper
wjhsf Sep 4, 2025
f1c50b0
test(wtr): import directly from file, not from barrel exporter
wjhsf Sep 4, 2025
7a73bf0
test(wtr): change bulk export statement to individual exports
wjhsf Sep 4, 2025
9b7b21b
test(wtr): remove unnecessary aria re-export
wjhsf Sep 4, 2025
9deaca2
test(wtr): fix a few more ARIA util imports
wjhsf Sep 4, 2025
1cf1275
chore: move comment for nicer aesthetic
wjhsf Sep 4, 2025
7fc137c
test(wtr): remove unused option
wjhsf Sep 4, 2025
ae937cc
test(wtr): fix another ARIA util import
wjhsf Sep 4, 2025
9250dd5
test(wtr): import directly from hooks file rather than utils
wjhsf Sep 4, 2025
d4280e8
test(wtr): import directly from signals file rather than utils
wjhsf Sep 4, 2025
bbffbf3
test(wtr): import directly from console helper rather than utils
wjhsf Sep 4, 2025
1ef88ed
test(wtr): import directly from constants helper rather than utils
wjhsf Sep 4, 2025
02f8ed1
test(wtr): only import what is needed from LWC
wjhsf Sep 4, 2025
7a5260a
test(wtr): split lwc:dynamic load helpers into separate file
wjhsf Sep 4, 2025
1a08a62
test(wtr): avoid relying on global LWC
wjhsf Sep 4, 2025
f14c829
Merge branch 'master' into wjh/wtr-smaller-utils
wjhsf Sep 9, 2025
289deeb
Merge branch 'master' into wjh/wtr-smaller-utils
wjhsf Sep 9, 2025
b97f783
test(wtr): remove unnecessary wrapping of hydration test config
wjhsf Sep 9, 2025
3cdb65c
test(wtr): remove test-utils logic from resolveImport
wjhsf Sep 9, 2025
7009a26
test(wtr): move plugin from shared config to only config that uses it
wjhsf Sep 9, 2025
19c1090
test(wtr): remove useless guid
wjhsf Sep 9, 2025
5e75329
test(wtr): remove unnecessary test-utils global
wjhsf Sep 9, 2025
497bfa8
test(wtr): clean up component definition
wjhsf Sep 9, 2025
8ff59c5
test(wtr): change component in test from IIFE to import
wjhsf Sep 11, 2025
885ce57
test(wtr): shift logic out of wrapper into static test runner file
wjhsf Sep 11, 2025
aa47c49
test(wtr): make test setup/teardown more idiomatic
wjhsf Sep 11, 2025
6185811
test(wtr): clean up module compilation
wjhsf Sep 11, 2025
ec0186f
chore(wtr): make dependency on @vitest/spy explicit
wjhsf Sep 11, 2025
3463450
test(wtr): remove console suppression
wjhsf Sep 11, 2025
7c0eb0a
test(wtr): clean up names and comments
wjhsf Sep 11, 2025
d91c8aa
Merge branch 'master' into wjh/wtr-clean-hydration
wjhsf Sep 11, 2025
371032d
Merge branch 'master' into wjh/wtr-clean-hydration
wjhsf Sep 12, 2025
c47a44d
test(wtr): move and rename file
wjhsf Sep 12, 2025
639f754
Merge branch 'master' into wjh/wtr-clean-hydration
wjhsf Sep 12, 2025
c21a895
test(wtr): remove usage of global TestUtils from hydration tests
wjhsf Sep 12, 2025
d041a23
test(wtr): remove LWC import from utils
wjhsf Sep 12, 2025
cb6213c
test(wtr): remove unused external deps
wjhsf Sep 12, 2025
76efacb
test(wtr): use imports instead of jasmine globals
wjhsf Sep 12, 2025
e86cbc4
chore(eslint): remove unused rule config
wjhsf Sep 12, 2025
136f47b
fix: attribute cte syntax in integration tests
jhefferman-sfdc Sep 16, 2025
6e31af9
test(wtr): fix case in import
wjhsf Sep 16, 2025
9805b58
test(wtr): re-enable tests that used to fail in CI
wjhsf Sep 16, 2025
67f727b
test(wtr): enable browser logs
wjhsf Sep 16, 2025
370da4c
Merge remote-tracking branch 'origin/jhefferman/fix-cte-integration-t…
wjhsf Sep 16, 2025
22822f7
test(wtr): name plugins
wjhsf Sep 16, 2025
654aef7
test(wtr): rename variables and document functions for clarity
wjhsf Sep 16, 2025
bc09749
test(wtr): convert promise chains to async/await
wjhsf Sep 16, 2025
99d6b27
Merge branch 'master' into wjh/wtr-spam
wjhsf Sep 16, 2025
c494abe
test(wtr): load code from known url, rather than sniffing script tag
wjhsf Sep 16, 2025
02ca871
test(wtr): convert LWC from iife to fake cjs
wjhsf Sep 17, 2025
85610ff
test(wtr): remove unnecessary wrapping
wjhsf Sep 17, 2025
96fa673
Merge branch 'master' into wjh/wtr-spam
wjhsf Sep 22, 2025
bcba665
test(wtr): data can be data, not a function
wjhsf Sep 22, 2025
b79d66b
test(wtr): replace `evaluate` with functions that require less wrapping
wjhsf Sep 22, 2025
3437c71
test(wtr): only fetch scripts once
wjhsf Sep 22, 2025
23491ec
test(wtr): john was here
wjhsf Sep 22, 2025
947612f
test(wtr): add line breaks and vars for clarity
wjhsf Sep 22, 2025
9fa8504
test(wtr): rename variable
wjhsf Sep 22, 2025
97ee6e9
test(wtr): fix param pass through
wjhsf Sep 22, 2025
159d046
test(wtr): more cleanup
wjhsf Sep 22, 2025
2e8abcf
test(wtr): remove outdated comment
wjhsf Sep 23, 2025
d9eda1d
test(wtr): avoid shadowing global var
wjhsf Sep 23, 2025
43818d5
test(wtr): enable custom element registry tests
wjhsf Sep 23, 2025
ec5293d
Merge branch 'master' into wjh/wtr-spam
wjhsf Sep 23, 2025
225da98
test(wtr): hoist function definition
wjhsf Sep 23, 2025
3d51c59
Apply suggestion from @jmsjtu
wjhsf Sep 24, 2025
076b8ad
test(wtr): clarify commonjs workarounds
wjhsf Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/@lwc/integration-not-karma/configs/base.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join } from 'node:path';
import { LWC_VERSION } from '@lwc/shared';
import * as options from '../helpers/options.js';
import { resolvePathOutsideRoot } from '../helpers/utils.js';

const pluck = (obj, keys) => Object.fromEntries(keys.map((k) => [k, obj[k]]));
const maybeImport = (file, condition) => (condition ? `await import('${file}');` : '');
Expand Down Expand Up @@ -28,17 +29,14 @@ export default {
// time out before they receive focus. But it also makes the full suite take 3x longer to run...
// Potential workaround: https://github.com/modernweb-dev/web/issues/2588
concurrency: 1,
filterBrowserLogs: () => false,
nodeResolve: true,
rootDir: join(import.meta.dirname, '..'),
plugins: [
{
name: 'lwc-base-plugin',
resolveImport({ source }) {
if (source === 'wire-service') {
// To serve files outside the web root (e.g. node_modules in the monorepo root),
// @web/dev-server provides this "magic" path. It's hacky of us to use it directly.
// `/__wds-outside-root__/${depth}/` === '../'.repeat(depth)
return '/__wds-outside-root__/1/wire-service/dist/index.js';
return resolvePathOutsideRoot('../wire-service/dist/index.js');
}
},
async transform(ctx) {
Expand All @@ -53,7 +51,6 @@ export default {
`<!DOCTYPE html>
<html>
<head>
<!-- scripts are included in the head so that the body can be fully reset between tests -->
<script type="module">
globalThis.process = ${JSON.stringify({ env })};
globalThis.lwcRuntimeFlags = ${JSON.stringify(
Expand Down
3 changes: 0 additions & 3 deletions packages/@lwc/integration-not-karma/configs/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export default {
// FIXME: These tests are just symlinks to integration-karma for now so the git diff smaller
'test/**/*.spec.js',

// Hacky nonsense highly tailored to Karma
'!test/custom-elements-registry/index.spec.js',

// Logging mismatches
'!test/component/LightningElement.addEventListener/index.spec.js',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ async function wrapHydrationTest(configPath) {

/** @type {import('@web/dev-server-core').Plugin} */
export default {
name: 'lwc-hydration-plugin',
async serve(ctx) {
// Hydration test "index.spec.js" files are actually just config files.
// They don't directly define the tests. Instead, when we request the file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ const transform = async (ctx) => {

/** @type {import('@web/dev-server-core').Plugin} */
export default {
name: 'lwc-integration-plugin',
async serve(ctx) {
if (ctx.path.endsWith('.spec.js')) {
return await transform(ctx);
Expand Down
11 changes: 11 additions & 0 deletions packages/@lwc/integration-not-karma/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,14 @@ export function expectEquivalentDOM(element, html) {

expectEquivalent(element, fragment.body.firstChild);
}

export const resolvePathOutsideRoot = (file) => {
return file.replace(/^(\.\.\/)+?(.+?)$/, (_, outside, filepath) => {
// To serve files from outside the web root (e.g. from the monorepo root
// node_modules, @web/dev-server provides this "magic" path. It's hacky
// of us to use it it directly.
// '../'.repeat(depth) becomes `/__wds-outside-root__/${depth}/`
const depth = outside.length / 3;
return `/__wds-outside-root__/${depth}/${filepath}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjhsf does this mean that @web/dev-server will handle appending the ../ for us?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/__wds-outside-root__/ is a magic path provided by @web/dev-server as a workaround for the fact that you can't ../ out of a web root (in our case, packages@/lwc/integration-not-karma).

When we serve pages with code like import * as LWC from 'lwc', @web/dev-server transforms that import before serving because node-style imports don't work in the browser. First it resolves the path, in this case to ../lwc/index.js. But that import wouldn't work, so it gets transformed again to /__wds-outside-root__/1/lwc/index.js. And then when the browser requests that file, the server knows where to look.

That's fine and dandy for regular imports, but sometimes we do weird hacky nonsense that needs the same transformation, but @web/dev-server doesn't do it for us. So we do it ourselves.

});
};
Loading