@leaflink/dom-testing-utils 4.2.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/setup-env.d.ts +1 -1
- package/dist/setup-env.js +26 -23
- package/dist/setup-env.js.map +1 -1
- package/dist/utils/cleanupDialogs.d.ts +10 -0
- package/dist/utils/cleanupDialogs.js +15 -0
- package/dist/utils/cleanupDialogs.js.map +1 -0
- package/dist/utils/cleanupDropdowns.d.ts +1 -1
- package/dist/utils/cleanupDropdowns.js +2 -2
- package/dist/utils/cleanupDropdowns.js.map +1 -1
- package/dist/utils/cleanupMenus.d.ts +10 -0
- package/dist/utils/cleanupMenus.js +15 -0
- package/dist/utils/cleanupMenus.js.map +1 -0
- package/dist/utils/cleanupModals.d.ts +1 -1
- package/dist/utils/cleanupModals.js +3 -3
- package/dist/utils/cleanupModals.js.map +1 -1
- package/dist/utils/cleanupNoty.js +1 -1
- package/dist/utils/cleanupNoty.js.map +1 -1
- package/dist/utils/cleanupToasts.d.ts +1 -1
- package/dist/utils/cleanupToasts.js +3 -3
- package/dist/utils/cleanupToasts.js.map +1 -1
- package/package.json +9 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { default as assertAndDismissNoty } from './utils/assertAndDismissNoty.js';
|
|
2
|
+
export { default as cleanupDialogs, cleanupDialogsMountNode } from './utils/cleanupDialogs.js';
|
|
2
3
|
export { default as cleanupDropdowns } from './utils/cleanupDropdowns.js';
|
|
3
|
-
export { default as
|
|
4
|
+
export { default as cleanupMenus, cleanupMenusMountNode } from './utils/cleanupMenus.js';
|
|
5
|
+
export { default as cleanupModals, cleanupModalsMountNode } from './utils/cleanupModals.js';
|
|
4
6
|
export { default as cleanupNoty } from './utils/cleanupNoty.js';
|
|
5
|
-
export { default as cleanupToasts } from './utils/cleanupToasts.js';
|
|
7
|
+
export { default as cleanupToasts, cleanupToastsMountNode } from './utils/cleanupToasts.js';
|
|
6
8
|
export { default as createFixtureGenerator } from './utils/createFixtureGenerator.js';
|
|
7
9
|
export { default as getAllByDescriptionTerm } from './utils/getAllByDescriptionTerm.js';
|
|
8
10
|
export { default as getByDescriptionTerm } from './utils/getByDescriptionTerm.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export { default as assertAndDismissNoty } from './utils/assertAndDismissNoty.js';
|
|
2
|
+
export { default as cleanupDialogs, cleanupDialogsMountNode } from './utils/cleanupDialogs.js';
|
|
2
3
|
export { default as cleanupDropdowns } from './utils/cleanupDropdowns.js';
|
|
3
|
-
export { default as
|
|
4
|
+
export { default as cleanupMenus, cleanupMenusMountNode } from './utils/cleanupMenus.js';
|
|
5
|
+
export { default as cleanupModals, cleanupModalsMountNode } from './utils/cleanupModals.js';
|
|
4
6
|
export { default as cleanupNoty } from './utils/cleanupNoty.js';
|
|
5
|
-
export { default as cleanupToasts } from './utils/cleanupToasts.js';
|
|
7
|
+
export { default as cleanupToasts, cleanupToastsMountNode } from './utils/cleanupToasts.js';
|
|
6
8
|
export { default as createFixtureGenerator } from './utils/createFixtureGenerator.js';
|
|
7
9
|
export { default as getAllByDescriptionTerm } from './utils/getAllByDescriptionTerm.js';
|
|
8
10
|
export { default as getByDescriptionTerm } from './utils/getByDescriptionTerm.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","s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
import '@testing-library/jest-dom';
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
package/dist/setup-env.js
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
|
-
import '@testing-library/jest-dom';
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|
|
2
2
|
import { configure as configureTestingLibrary } from '@testing-library/vue';
|
|
3
3
|
import { config, flushPromises } from '@vue/test-utils';
|
|
4
4
|
import { vi } from 'vitest';
|
|
5
|
+
import cleanupDialogs, { cleanupDialogsMountNode } from './utils/cleanupDialogs.js';
|
|
5
6
|
import cleanupDropdowns from './utils/cleanupDropdowns.js';
|
|
7
|
+
import cleanupMenus, { cleanupMenusMountNode } from './utils/cleanupMenus.js';
|
|
6
8
|
import cleanupModals, { cleanupModalsMountNode } from './utils/cleanupModals.js';
|
|
7
9
|
import cleanupNoty from './utils/cleanupNoty.js';
|
|
8
10
|
import cleanupToasts, { cleanupToastsMountNode } from './utils/cleanupToasts.js';
|
|
11
|
+
afterEach(() => {
|
|
12
|
+
cleanupModals();
|
|
13
|
+
cleanupToasts();
|
|
14
|
+
cleanupDialogs();
|
|
15
|
+
cleanupMenus();
|
|
16
|
+
cleanupNoty();
|
|
17
|
+
cleanupDropdowns();
|
|
18
|
+
});
|
|
19
|
+
afterEach(async () => {
|
|
20
|
+
// flush out any pending promises so they will fail the test instead of asynchronously at the wrong time
|
|
21
|
+
await flushPromises();
|
|
22
|
+
});
|
|
23
|
+
afterAll(() => {
|
|
24
|
+
// restore `window.location` to the original `jsdom`
|
|
25
|
+
// `Location` object
|
|
26
|
+
global.window.location = oldWindowLocation;
|
|
27
|
+
// remove mount nodes from the DOM
|
|
28
|
+
cleanupModalsMountNode();
|
|
29
|
+
cleanupToastsMountNode();
|
|
30
|
+
cleanupDialogsMountNode();
|
|
31
|
+
cleanupMenusMountNode();
|
|
32
|
+
});
|
|
9
33
|
// checking if an element is hidden is quite expensive
|
|
10
34
|
// this is only done in CI as a fail safe. It can still explicitly be checked
|
|
11
35
|
// in the test files which helps documenting what is part of the DOM but hidden
|
|
12
36
|
// from assistive technology
|
|
13
37
|
const defaultHidden = !process.env.CI;
|
|
14
38
|
configureTestingLibrary({ testIdAttribute: 'data-test', defaultHidden });
|
|
15
|
-
// Mock debounce
|
|
39
|
+
// Mock the debounce function so that we can test it synchronously
|
|
16
40
|
vi.mock('lodash-es/debounce', () => {
|
|
17
41
|
return {
|
|
18
42
|
default: (fn) => {
|
|
@@ -48,27 +72,6 @@ global.window.ResizeObserver =
|
|
|
48
72
|
unobserve() { }
|
|
49
73
|
disconnect() { }
|
|
50
74
|
};
|
|
51
|
-
afterAll(() => {
|
|
52
|
-
cleanupModalsMountNode();
|
|
53
|
-
cleanupToastsMountNode();
|
|
54
|
-
});
|
|
55
|
-
afterEach(() => {
|
|
56
|
-
cleanupModals();
|
|
57
|
-
cleanupToasts();
|
|
58
|
-
cleanupNoty();
|
|
59
|
-
cleanupDropdowns();
|
|
60
|
-
});
|
|
61
|
-
afterEach(async () => {
|
|
62
|
-
// flush out any pending promises so they will fail the test instead of asynchronously at
|
|
63
|
-
// the wrong time
|
|
64
|
-
// Todo: figure out why this isnt working
|
|
65
|
-
await flushPromises();
|
|
66
|
-
});
|
|
67
|
-
afterAll(() => {
|
|
68
|
-
// restore `window.location` to the original `jsdom`
|
|
69
|
-
// `Location` object
|
|
70
|
-
global.window.location = oldWindowLocation;
|
|
71
|
-
});
|
|
72
75
|
const IntersectionObserverMock = vi.fn(() => ({
|
|
73
76
|
get root() {
|
|
74
77
|
return;
|
package/dist/setup-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-env.js","sourceRoot":"src/","sources":["setup-env.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"setup-env.js","sourceRoot":"src/","sources":["setup-env.ts"],"names":[],"mappings":"AAAA,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAE,SAAS,IAAI,uBAAuB,EAAE,MAAM,sBA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;QACN,OAAO;IACT,CAAC;IACD,UAAU,EAAE,EAAE,CAAC,EAAE,EAAE;IACnB,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;IACpB,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;CACnB,CAAC,CAAC,CAAC;AAEJ,EAAE,CAAC,UAAU,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;AAEhE,6DAA6D;AAC7D,0DAA0D;AAC1D,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3F,6CAA6C;AAC7C,OAAO,CAAC,SAAS,CAAC,cAAc,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;AAE3C,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,EAAE,CAAC,EAAE,EAAE;IACpB,cAAc,EAAE,EAAE,CAAC,EAAE,EAAE;IACvB,gBAAgB,EAAE,EAAE,CAAC,EAAE,EAAE;IACzB,mBAAmB,EAAE,EAAE,CAAC,EAAE,EAAE;IAC5B,aAAa,EAAE,EAAE,CAAC,EAAE,EAAE;CACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper method to remove all Stash dialogs from the DOM.
|
|
3
|
+
*
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export default function cleanupDialogs(selector?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Helper method to remove the dialogs' mount node from the DOM.
|
|
9
|
+
*/
|
|
10
|
+
export declare function cleanupDialogsMountNode(selector?: string): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper method to remove all Stash dialogs from the DOM.
|
|
3
|
+
*
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export default function cleanupDialogs(selector = '.stash-dialog') {
|
|
7
|
+
document.querySelectorAll(selector).forEach((elem) => elem.remove());
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Helper method to remove the dialogs' mount node from the DOM.
|
|
11
|
+
*/
|
|
12
|
+
export function cleanupDialogsMountNode(selector = '#stash-dialogs-mount-node') {
|
|
13
|
+
document.querySelector(selector)?.remove();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cleanupDialogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanupDialogs.js","sourceRoot":"src/","sources":["utils/cleanupDialogs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,QAAQ,GAAG,eAAe;IAC/D,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAQ,GAAG,2BAA2B;IAC5E,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
|
-
export default function cleanupDropdowns() {
|
|
7
|
-
document.querySelectorAll(
|
|
6
|
+
export default function cleanupDropdowns(selector = '.mount-point-container') {
|
|
7
|
+
document.querySelectorAll(selector).forEach((elem) => elem.remove());
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=cleanupDropdowns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupDropdowns.js","sourceRoot":"src/","sources":["utils/cleanupDropdowns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB;
|
|
1
|
+
{"version":3,"file":"cleanupDropdowns.js","sourceRoot":"src/","sources":["utils/cleanupDropdowns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,QAAQ,GAAG,wBAAwB;IAC1E,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper method to remove all Stash menus from the DOM.
|
|
3
|
+
*
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export default function cleanupMenus(selector?: string): void;
|
|
7
|
+
/**
|
|
8
|
+
* Helper method to remove the menus' mount node from the DOM.
|
|
9
|
+
*/
|
|
10
|
+
export declare function cleanupMenusMountNode(selector?: string): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper method to remove all Stash menus from the DOM.
|
|
3
|
+
*
|
|
4
|
+
* @returns void
|
|
5
|
+
*/
|
|
6
|
+
export default function cleanupMenus(selector = '#stash-menus-mount-node > div') {
|
|
7
|
+
document.querySelectorAll(selector).forEach((elem) => elem.remove());
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Helper method to remove the menus' mount node from the DOM.
|
|
11
|
+
*/
|
|
12
|
+
export function cleanupMenusMountNode(selector = '#stash-menus-mount-node') {
|
|
13
|
+
document.querySelector(selector)?.remove();
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cleanupMenus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanupMenus.js","sourceRoot":"src/","sources":["utils/cleanupMenus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,QAAQ,GAAG,+BAA+B;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAQ,GAAG,yBAAyB;IACxE,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
|
-
export default function cleanupModals() {
|
|
7
|
-
document.querySelectorAll(
|
|
6
|
+
export default function cleanupModals(selector = '.stash-modal') {
|
|
7
|
+
document.querySelectorAll(selector).forEach((elem) => elem.remove());
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Helper method to remove the modals' mount node from the DOM.
|
|
11
11
|
*/
|
|
12
12
|
export function cleanupModalsMountNode(selector = '#stash-modals-mount-node') {
|
|
13
|
-
document.
|
|
13
|
+
document.querySelector(selector)?.remove();
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=cleanupModals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupModals.js","sourceRoot":"src/","sources":["utils/cleanupModals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;
|
|
1
|
+
{"version":3,"file":"cleanupModals.js","sourceRoot":"src/","sources":["utils/cleanupModals.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,QAAQ,GAAG,cAAc;IAC7D,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAQ,GAAG,0BAA0B;IAC1E,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
6
|
export default function cleanupNoty() {
|
|
7
|
-
document.querySelectorAll('.noty_bar').forEach((elem) => elem.
|
|
7
|
+
document.querySelectorAll('.noty_bar').forEach((elem) => elem.remove());
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=cleanupNoty.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupNoty.js","sourceRoot":"src/","sources":["utils/cleanupNoty.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cleanupNoty.js","sourceRoot":"src/","sources":["utils/cleanupNoty.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW;IACjC,QAAQ,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @returns void
|
|
5
5
|
*/
|
|
6
|
-
export default function cleanupToasts() {
|
|
7
|
-
document.querySelectorAll(
|
|
6
|
+
export default function cleanupToasts(selector = '.stash-toast') {
|
|
7
|
+
document.querySelectorAll(selector).forEach((elem) => elem.remove());
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Helper method to remove the toasts' mount node from the DOM.
|
|
11
11
|
*/
|
|
12
12
|
export function cleanupToastsMountNode(selector = '#stash-toasts-mount-node') {
|
|
13
|
-
document.
|
|
13
|
+
document.querySelector(selector)?.remove();
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=cleanupToasts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupToasts.js","sourceRoot":"src/","sources":["utils/cleanupToasts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa;
|
|
1
|
+
{"version":3,"file":"cleanupToasts.js","sourceRoot":"src/","sources":["utils/cleanupToasts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,QAAQ,GAAG,cAAc;IAC7D,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,QAAQ,GAAG,0BAA0B;IAC1E,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leaflink/dom-testing-utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Frontend DOM testing utilities",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=18",
|
|
7
7
|
"npm": ">=8"
|
|
8
8
|
},
|
|
9
9
|
"exports": {
|
|
@@ -40,9 +40,6 @@
|
|
|
40
40
|
},
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@testing-library/jest-dom": "^6.1.3",
|
|
44
|
-
"@testing-library/user-event": "^14.5.1",
|
|
45
|
-
"@testing-library/vue": "^7.0.0",
|
|
46
43
|
"msw": "^2.0.8"
|
|
47
44
|
},
|
|
48
45
|
"devDependencies": {
|
|
@@ -54,6 +51,13 @@
|
|
|
54
51
|
"vite": "^4.4.9",
|
|
55
52
|
"vitest": "^0.34.5"
|
|
56
53
|
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@testing-library/jest-dom": "^5 || ^6",
|
|
56
|
+
"@testing-library/user-event": "^12 || ^13 || ^14",
|
|
57
|
+
"@testing-library/vue": "^7 || ^8",
|
|
58
|
+
"@vue/test-utils": "^2",
|
|
59
|
+
"vue": "^3.2.31"
|
|
60
|
+
},
|
|
57
61
|
"eslintConfig": {
|
|
58
62
|
"extends": [
|
|
59
63
|
"leaflink"
|