Skip to content

Commit ec2b734

Browse files
authored
Merge branch 'master' into rave/trojan-horse
2 parents 26c6c46 + 475662e commit ec2b734

File tree

101 files changed

+205
-155
lines changed

Some content is hidden

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

101 files changed

+205
-155
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@types/babel__core": "^7.20.5",
5454
"@types/node": "^22.18.0",
5555
"@vitest/coverage-v8": "^3.2.4",
56-
"@vitest/eslint-plugin": "^1.3.4",
56+
"@vitest/eslint-plugin": "^1.3.6",
5757
"@vitest/ui": "^3.2.4",
5858
"bytes": "^3.1.2",
5959
"es-module-lexer": "^1.7.0",

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

packages/@lwc/integration-not-karma/helpers/test-hydrate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as LWC from 'lwc';
2+
import { spyConsole } from './console';
3+
import { setHooks } from './hooks';
24

3-
window.TestUtils.setHooks({
4-
sanitizeHtmlContent: (content) => content,
5-
});
5+
setHooks({ sanitizeHtmlContent: (content) => content });
66

77
function parseStringToDom(html) {
88
return Document.parseHTMLUnsafe(html).body.firstChild;
@@ -28,7 +28,7 @@ async function runTest(ssrRendered, Component, testConfig) {
2828
let target = container.querySelector(selector);
2929

3030
let testResult;
31-
const consoleSpy = window.TestUtils.spyConsole();
31+
const consoleSpy = spyConsole();
3232
setFeatureFlags(testConfig.requiredFeatureFlags, true);
3333

3434
if (testConfig.test) {

packages/@lwc/integration-not-karma/mocks/lwc.mjs

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/@lwc/integration-not-karma/test/accessibility/non-standard-aria-props/index.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { createElement } from 'lwc';
2+
import Light from 'x/light';
3+
import Shadow from 'x/shadow';
24
import {
35
attachReportingControlDispatcher,
46
detachReportingControlDispatcher,
57
nonStandardAriaProperties,
6-
} from 'test-utils';
7-
import Light from 'x/light';
8-
import Shadow from 'x/shadow';
8+
} from '../../../helpers/utils.js';
99

1010
// This test only works if the ARIA reflection polyfill is loaded
1111
describe.runIf(process.env.ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL)(

packages/@lwc/integration-not-karma/test/accessibility/synthetic-cross-root-aria/index.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { createElement } from 'lwc';
2-
import { attachReportingControlDispatcher, detachReportingControlDispatcher } from 'test-utils';
32

43
import AriaContainer from 'x/ariaContainer';
54
import Valid from 'x/valid';
5+
import {
6+
attachReportingControlDispatcher,
7+
detachReportingControlDispatcher,
8+
} from '../../../helpers/utils.js';
69

710
const expectedMessageForCrossRoot =
811
'Error: [LWC warn]: Element <input> uses attribute "aria-labelledby" to reference element <label>, which is not in the same shadow root. This will break in native shadow DOM. For details, see: https://sfdc.co/synthetic-aria\n<x-aria-source>';

packages/@lwc/integration-not-karma/test/act/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import UiAnother from 'ui/another';
1515
import UiOutputPercent from 'ui/outputpercent';
1616
import ForceFoo from 'force/foo';
1717
import NestedHtmlTags from 'nested/htmlTags';
18-
import { extractDataIds } from 'test-utils';
18+
import { extractDataIds } from '../../helpers/utils.js';
1919
import testProps from './act-components/test-props';
2020
import testAttrs from './act-components/test-attrs';
2121
import testBodySlot from './act-components/test-body-slot';

packages/@lwc/integration-not-karma/test/api/CustomElementConstructor-getter/index.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { LightningElement } from 'lwc';
2-
import { USE_COMMENTS_FOR_FRAGMENT_BOOKENDS } from 'test-utils';
32

43
import ReflectElement from 'x/reflect';
54
import LifecycleParent from 'x/lifecycleParent';
@@ -10,6 +9,8 @@ import AttrChanged from 'x/attrChanged';
109
import ReflectCamel from 'x/reflectCamel';
1110
import WithChildElmsHasSlot from 'x/withChildElmsHasSlot';
1211
import WithChildElmsHasSlotLight from 'x/withChildElmsHasSlotLight';
12+
import { spyConsole } from '../../../helpers/utils.js';
13+
import { USE_COMMENTS_FOR_FRAGMENT_BOOKENDS } from '../../../helpers/utils.js';
1314

1415
const vFragBookend = USE_COMMENTS_FOR_FRAGMENT_BOOKENDS ? '<!---->' : '';
1516

@@ -68,7 +69,7 @@ it('should create custom element if it exists before customElements.define', ()
6869
describe('non-empty custom element', () => {
6970
let consoleSpy;
7071
beforeEach(() => {
71-
consoleSpy = TestUtils.spyConsole();
72+
consoleSpy = spyConsole();
7273
});
7374
afterEach(() => {
7475
consoleSpy.reset();

packages/@lwc/integration-not-karma/test/api/createElement/index.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import { createElement, LightningElement, setFeatureFlagForTest } from 'lwc';
2-
import { isNativeShadowRootInstance, isSyntheticShadowRootInstance } from 'test-utils';
32

43
import Test from 'x/test';
54
import ShadowRootGetter from 'x/shadowRootGetter';
5+
import {
6+
isNativeShadowRootInstance,
7+
isSyntheticShadowRootInstance,
8+
} from '../../../helpers/utils.js';
69

710
function testInvalidOptions(type, option) {
811
it(`throws a TypeError if option is a ${type}`, () => {

packages/@lwc/integration-not-karma/test/api/freezeTemplate/index.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { registerTemplate, freezeTemplate, setFeatureFlagForTest } from 'lwc';
22

3-
import { attachReportingControlDispatcher, detachReportingControlDispatcher } from 'test-utils';
3+
import {
4+
attachReportingControlDispatcher,
5+
detachReportingControlDispatcher,
6+
} from '../../../helpers/utils.js';
47

58
describe('freezeTemplate', () => {
69
let dispatcher;

0 commit comments

Comments
 (0)