Skip to content

Commit 90c13d9

Browse files
build(deps-dev): bump @vitest/spy from 3.2.4 to 4.0.4 (#5559)
* build(deps-dev): bump @vitest/spy from 3.2.4 to 4.0.4 Bumps [@vitest/spy](https://github.com/vitest-dev/vitest/tree/HEAD/packages/spy) from 3.2.4 to 4.0.4. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.4/packages/spy) --- updated-dependencies: - dependency-name: "@vitest/spy" dependency-version: 4.0.4 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * test(wtr): remove unnecessary jasmine spies * test(wtr): remove some jasmine spy adapters * test(wtr): remove allArgs jasmine adapter * test(wtr): remove argsFor jasmine adapter * test(wtr): remove jasmine.any and jasmine.objectContaining * test(wtr): remove arrayWithExactContents it was implemented locally in one test file * test(wtr): fully remove jasmine adapters * test(wtr): reset mock --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Will Harney <wharney@salesforce.com>
1 parent 3d2fd23 commit 90c13d9

File tree

35 files changed

+216
-233
lines changed

35 files changed

+216
-233
lines changed

packages/@lwc/integration-not-karma/helpers/jasmine.js

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

packages/@lwc/integration-not-karma/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@types/chai": "^5.2.2",
1919
"@types/jasmine": "^5.1.12",
2020
"@vitest/expect": "^3.2.4",
21-
"@vitest/spy": "^3.2.4",
21+
"@vitest/spy": "^4.0.4",
2222
"@web/dev-server-import-maps": "^0.2.1",
2323
"@web/dev-server-rollup": "^0.6.4",
2424
"@web/test-runner": "^0.20.2",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createElement } from 'lwc';
22
import Light from 'x/light';
33
import Shadow from 'x/shadow';
4-
import { jasmine } from '../../../helpers/jasmine.js';
4+
import { fn as mockFn } from '@vitest/spy';
55
import { nonStandardAriaProperties } from '../../../helpers/aria.js';
66
import {
77
attachReportingControlDispatcher,
@@ -16,7 +16,7 @@ describe.runIf(process.env.ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL)(
1616
let dispatcher;
1717

1818
beforeEach(() => {
19-
dispatcher = jasmine.createSpy();
19+
dispatcher = mockFn();
2020
attachReportingControlDispatcher(dispatcher, ['NonStandardAriaReflection']);
2121
});
2222

@@ -69,7 +69,7 @@ describe.runIf(process.env.ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL)(
6969
elm.getPropOnElement(prop);
7070
}).toLogWarningDev(inComponentWarning);
7171

72-
expect(dispatcher.calls.allArgs()).toEqual([
72+
expect(dispatcher.mock.calls).toEqual([
7373
[
7474
'NonStandardAriaReflection',
7575
{
@@ -100,7 +100,7 @@ describe.runIf(process.env.ENABLE_ARIA_REFLECTION_GLOBAL_POLYFILL)(
100100
return unused; // remove lint warning
101101
}).toLogWarningDev(outsideComponentWarning);
102102

103-
expect(dispatcher.calls.allArgs()).toEqual([
103+
expect(dispatcher.mock.calls).toEqual([
104104
[
105105
'NonStandardAriaReflection',
106106
{

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { createElement } from 'lwc';
22

33
import AriaContainer from 'x/ariaContainer';
44
import Valid from 'x/valid';
5-
import { jasmine } from '../../../helpers/jasmine.js';
5+
import { fn as mockFn } from '@vitest/spy';
66
import {
77
attachReportingControlDispatcher,
88
detachReportingControlDispatcher,
@@ -23,7 +23,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
2323
let dispatcher;
2424

2525
beforeEach(() => {
26-
dispatcher = jasmine.createSpy();
26+
dispatcher = mockFn();
2727
attachReportingControlDispatcher(dispatcher, [
2828
'CrossRootAriaInSyntheticShadow',
2929
'NonStandardAriaReflection',
@@ -107,14 +107,14 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
107107
expect(() => {
108108
elm.linkUsingAriaLabelledBy();
109109
}).toLogWarningDev(expectedMessages);
110-
expect(dispatcher.calls.allArgs()).toEqual(getExpectedDispatcherCalls(true));
110+
expect(dispatcher.mock.calls).toEqual(getExpectedDispatcherCalls(true));
111111
});
112112

113113
it('setting id', () => {
114114
expect(() => {
115115
elm.linkUsingId();
116116
}).toLogWarningDev(expectedMessages);
117-
expect(dispatcher.calls.allArgs()).toEqual(getExpectedDispatcherCalls(false));
117+
expect(dispatcher.mock.calls).toEqual(getExpectedDispatcherCalls(false));
118118
});
119119

120120
it('linking to an element in global light DOM', () => {
@@ -124,7 +124,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
124124
expect(() => {
125125
sourceElm.setAriaLabelledBy('foo');
126126
}).toLogWarningDev(expectedMessages);
127-
expect(dispatcher.calls.allArgs()).toEqual(getExpectedDispatcherCalls(true));
127+
expect(dispatcher.mock.calls).toEqual(getExpectedDispatcherCalls(true));
128128
});
129129

130130
it('linking from an element in global light DOM', () => {
@@ -135,7 +135,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
135135
expect(() => {
136136
targetElm.setId('foo');
137137
}).toLogWarningDev(expectedMessageForCrossRootWithTargetAsVM);
138-
expect(dispatcher.calls.allArgs()).toEqual([
138+
expect(dispatcher.mock.calls).toEqual([
139139
[
140140
'CrossRootAriaInSyntheticShadow',
141141
{
@@ -158,7 +158,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
158158
});
159159

160160
if (usePropertyAccess) {
161-
expect(dispatcher.calls.allArgs()).toEqual([
161+
expect(dispatcher.mock.calls).toEqual([
162162
[
163163
'NonStandardAriaReflection',
164164
{
@@ -181,7 +181,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
181181
});
182182

183183
if (usePropertyAccess) {
184-
expect(dispatcher.calls.allArgs()).toEqual([
184+
expect(dispatcher.mock.calls).toEqual([
185185
[
186186
'NonStandardAriaReflection',
187187
{
@@ -210,9 +210,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
210210
expect(() => {
211211
elm.linkUsingBoth(options);
212212
}).toLogWarningDev(expectedMessages);
213-
expect(dispatcher.calls.allArgs()).toEqual(
214-
getExpectedDispatcherCalls(true)
215-
);
213+
expect(dispatcher.mock.calls).toEqual(getExpectedDispatcherCalls(true));
216214
});
217215

218216
it('linking multiple targets', () => {
@@ -223,7 +221,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
223221
expectedMessageForCrossRootForSecondTarget,
224222
]);
225223

226-
expect(dispatcher.calls.allArgs()).toEqual([
224+
expect(dispatcher.mock.calls).toEqual([
227225
...getExpectedDispatcherCalls(true),
228226
[
229227
'CrossRootAriaInSyntheticShadow',
@@ -253,7 +251,7 @@ describe.skipIf(process.env.NATIVE_SHADOW)('synthetic shadow cross-root ARIA', (
253251
}).toLogWarningDev(expectedMessageForCrossRoot);
254252

255253
// dispatcher is still called twice
256-
expect(dispatcher.calls.allArgs()).toEqual([
254+
expect(dispatcher.mock.calls).toEqual([
257255
[
258256
'CrossRootAriaInSyntheticShadow',
259257
{

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { registerTemplate, freezeTemplate, setFeatureFlagForTest } from 'lwc';
2-
import { jasmine } from '../../../helpers/jasmine.js';
32

3+
import { fn as mockFn } from '@vitest/spy';
44
import {
55
attachReportingControlDispatcher,
66
detachReportingControlDispatcher,
@@ -11,7 +11,7 @@ describe('freezeTemplate', () => {
1111
let dispatcher;
1212

1313
beforeEach(() => {
14-
dispatcher = jasmine.createSpy();
14+
dispatcher = mockFn();
1515
attachReportingControlDispatcher(dispatcher, ['StylesheetMutation', 'TemplateMutation']);
1616
});
1717

@@ -36,7 +36,7 @@ describe('freezeTemplate', () => {
3636
);
3737

3838
expect(template.stylesheetToken).toEqual('newToken');
39-
expect(dispatcher.calls.allArgs()).toEqual([
39+
expect(dispatcher.mock.calls).toEqual([
4040
['TemplateMutation', { propertyName: 'stylesheetToken' }],
4141
]);
4242
});
@@ -66,7 +66,7 @@ describe('freezeTemplate', () => {
6666
hostAttribute: 'newToken-host',
6767
shadowAttribute: 'newToken',
6868
});
69-
expect(dispatcher.calls.allArgs()).toEqual([
69+
expect(dispatcher.mock.calls).toEqual([
7070
['TemplateMutation', { propertyName: 'stylesheetTokens' }],
7171
]);
7272
});
@@ -91,7 +91,7 @@ describe('freezeTemplate', () => {
9191

9292
expect(template.stylesheets.length).toEqual(1);
9393
expect(template.stylesheets[0]).toBe(newStylesheet);
94-
expect(dispatcher.calls.allArgs()).toEqual([
94+
expect(dispatcher.mock.calls).toEqual([
9595
['TemplateMutation', { propertyName: 'stylesheets' }],
9696
]);
9797
});
@@ -128,7 +128,7 @@ describe('freezeTemplate', () => {
128128

129129
expect(template.stylesheets.length).toEqual(1);
130130
expect(template.stylesheets[0]).toBe(stylesheet);
131-
expect(dispatcher.calls.allArgs()).toEqual([
131+
expect(dispatcher.mock.calls).toEqual([
132132
['TemplateMutation', { propertyName: 'stylesheets' }],
133133
['TemplateMutation', { propertyName: 'stylesheets' }],
134134
]);
@@ -149,7 +149,7 @@ describe('freezeTemplate', () => {
149149
}).toLogWarningDev(
150150
/Mutating the "stylesheets" property on a template is deprecated and will be removed in a future version of LWC/
151151
);
152-
expect(dispatcher.calls.allArgs()).toEqual([
152+
expect(dispatcher.mock.calls).toEqual([
153153
['TemplateMutation', { propertyName: 'stylesheets' }],
154154
]);
155155
});
@@ -170,9 +170,7 @@ describe('freezeTemplate', () => {
170170
);
171171

172172
expect(template.slots).toBe(newSlots);
173-
expect(dispatcher.calls.allArgs()).toEqual([
174-
['TemplateMutation', { propertyName: 'slots' }],
175-
]);
173+
expect(dispatcher.mock.calls).toEqual([['TemplateMutation', { propertyName: 'slots' }]]);
176174
});
177175

178176
it('should warn when setting tmpl.renderMOde', () => {
@@ -189,7 +187,7 @@ describe('freezeTemplate', () => {
189187
);
190188

191189
expect(template.renderMode).toBe(undefined);
192-
expect(dispatcher.calls.allArgs()).toEqual([
190+
expect(dispatcher.mock.calls).toEqual([
193191
['TemplateMutation', { propertyName: 'renderMode' }],
194192
]);
195193
});
@@ -206,7 +204,7 @@ describe('freezeTemplate', () => {
206204
}).toLogWarningDev(
207205
/Mutating the "\$scoped\$" property on a stylesheet is deprecated and will be removed in a future version of LWC\./
208206
);
209-
expect(dispatcher.calls.allArgs()).toEqual([
207+
expect(dispatcher.mock.calls).toEqual([
210208
['StylesheetMutation', { propertyName: '$scoped$' }],
211209
]);
212210
});

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import PublicPropertiesInheritance from 'x/publicPropertiesInheritance';
77
import PublicMethodsInheritance from 'x/publicMethodsInheritance';
88
import PrivateAccessors from 'x/privateAccessors';
99
import HtmlElementProps from 'x/htmlElementProps';
10-
import { jasmine } from '../../../helpers/jasmine.js';
1110
import { ariaProperties } from '../../../helpers/aria.js';
1211

1312
function testInvalidComponentConstructor(name, ctor) {
@@ -53,7 +52,7 @@ describe('@api', () => {
5352
it('should return the public properties in the props object', () => {
5453
const { props } = getComponentDef(PublicProperties);
5554
expect(props).toEqual(
56-
jasmine.objectContaining({
55+
expect.objectContaining({
5756
foo: {
5857
config: 0,
5958
type: 'any',
@@ -71,7 +70,7 @@ describe('@api', () => {
7170
it('should return the public accessors in the props object', () => {
7271
const { props } = getComponentDef(PublicAccessors);
7372
expect(props).toEqual(
74-
jasmine.objectContaining({
73+
expect.objectContaining({
7574
getterOnly: {
7675
config: 1,
7776
type: 'any',
@@ -97,7 +96,7 @@ describe('@api', () => {
9796
it('should return also the public properties inherited from the base class', () => {
9897
const { props } = getComponentDef(PublicPropertiesInheritance);
9998
expect(props).toEqual(
100-
jasmine.objectContaining({
99+
expect.objectContaining({
101100
parentProp: {
102101
config: 3,
103102
type: 'any',
@@ -231,7 +230,7 @@ describe('circular dependencies', () => {
231230

232231
const { props } = getComponentDef(Component);
233232
expect(props).toEqual(
234-
jasmine.objectContaining({
233+
expect.objectContaining({
235234
foo: {
236235
config: 0,
237236
type: 'any',
@@ -275,7 +274,7 @@ describe('circular dependencies', () => {
275274
}
276275
const { props } = getComponentDef(Component);
277276
expect(props).toEqual(
278-
jasmine.objectContaining({
277+
expect.objectContaining({
279278
bar: {
280279
config: 0,
281280
type: 'any',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createElement, isNodeFromTemplate } from 'lwc';
22
import Test from 'x/test';
3-
import { jasmineSpyOn as spyOn } from '../../../helpers/jasmine.js';
3+
import { spyOn } from '@vitest/spy';
44

55
function testNonNodes(type, obj) {
66
it(`should return false if the passed object if a ${type}`, () => {

0 commit comments

Comments
 (0)