@testing-library/svelte 5.2.4 → 5.2.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/svelte",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.5",
|
|
4
4
|
"description": "Simple and complete Svelte testing utilities that encourage good testing practices.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@jest/globals": "^29.7.0",
|
|
98
|
-
"@sveltejs/vite-plugin-svelte": "^3.
|
|
98
|
+
"@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0 || ^4.0.0",
|
|
99
99
|
"@testing-library/jest-dom": "^6.3.0",
|
|
100
100
|
"@testing-library/user-event": "^14.5.2",
|
|
101
101
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"eslint-plugin-promise": "^6.4.0",
|
|
112
112
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
113
113
|
"eslint-plugin-svelte": "^2.42.0",
|
|
114
|
-
"expect-type": "^
|
|
114
|
+
"expect-type": "^1.1.0",
|
|
115
115
|
"happy-dom": "^15.7.3",
|
|
116
116
|
"jest": "^29.7.0",
|
|
117
117
|
"jest-environment-jsdom": "^29.7.0",
|
package/src/component-types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents */
|
|
2
2
|
import type * as Svelte from 'svelte'
|
|
3
3
|
|
|
4
|
-
type IS_MODERN_SVELTE =
|
|
4
|
+
type IS_MODERN_SVELTE = Svelte.Component extends (...args: any[]) => any
|
|
5
|
+
? true
|
|
6
|
+
: false
|
|
5
7
|
|
|
6
8
|
/** A compiled, imported Svelte component. */
|
|
7
9
|
export type Component<
|
|
@@ -14,12 +16,12 @@ export type Component<
|
|
|
14
16
|
/**
|
|
15
17
|
* The type of an imported, compiled Svelte component.
|
|
16
18
|
*
|
|
17
|
-
* In Svelte 4, this was the Svelte component class' type.
|
|
18
19
|
* In Svelte 5, this distinction no longer matters.
|
|
20
|
+
* In Svelte 4, this is the Svelte component class constructor.
|
|
19
21
|
*/
|
|
20
|
-
export type ComponentType<C> =
|
|
21
|
-
?
|
|
22
|
-
: C
|
|
22
|
+
export type ComponentType<C> = IS_MODERN_SVELTE extends true
|
|
23
|
+
? C
|
|
24
|
+
: new (...args: any[]) => C
|
|
23
25
|
|
|
24
26
|
/** The props of a component. */
|
|
25
27
|
export type Props<C extends Component<any, any>> = Svelte.ComponentProps<C>
|
|
@@ -27,8 +29,8 @@ export type Props<C extends Component<any, any>> = Svelte.ComponentProps<C>
|
|
|
27
29
|
/**
|
|
28
30
|
* The exported fields of a component.
|
|
29
31
|
*
|
|
30
|
-
* In Svelte 4, this is simply the instance of the component class.
|
|
31
32
|
* In Svelte 5, this is the set of variables marked as `export`'d.
|
|
33
|
+
* In Svelte 4, this is simply the instance of the component class.
|
|
32
34
|
*/
|
|
33
35
|
export type Exports<C> = C extends Svelte.SvelteComponent
|
|
34
36
|
? C
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-redundant-type-constituents */
|
|
2
2
|
import type * as Svelte from 'svelte'
|
|
3
3
|
|
|
4
|
-
type IS_MODERN_SVELTE =
|
|
4
|
+
type IS_MODERN_SVELTE = Svelte.Component extends (...args: any[]) => any
|
|
5
|
+
? true
|
|
6
|
+
: false
|
|
5
7
|
|
|
6
8
|
/** A compiled, imported Svelte component. */
|
|
7
9
|
export type Component<
|
|
@@ -14,12 +16,12 @@ export type Component<
|
|
|
14
16
|
/**
|
|
15
17
|
* The type of an imported, compiled Svelte component.
|
|
16
18
|
*
|
|
17
|
-
* In Svelte 4, this was the Svelte component class' type.
|
|
18
19
|
* In Svelte 5, this distinction no longer matters.
|
|
20
|
+
* In Svelte 4, this is the Svelte component class constructor.
|
|
19
21
|
*/
|
|
20
|
-
export type ComponentType<C> =
|
|
21
|
-
?
|
|
22
|
-
: C
|
|
22
|
+
export type ComponentType<C> = IS_MODERN_SVELTE extends true
|
|
23
|
+
? C
|
|
24
|
+
: new (...args: any[]) => C
|
|
23
25
|
|
|
24
26
|
/** The props of a component. */
|
|
25
27
|
export type Props<C extends Component<any, any>> = Svelte.ComponentProps<C>
|
|
@@ -27,8 +29,8 @@ export type Props<C extends Component<any, any>> = Svelte.ComponentProps<C>
|
|
|
27
29
|
/**
|
|
28
30
|
* The exported fields of a component.
|
|
29
31
|
*
|
|
30
|
-
* In Svelte 4, this is simply the instance of the component class.
|
|
31
32
|
* In Svelte 5, this is the set of variables marked as `export`'d.
|
|
33
|
+
* In Svelte 4, this is simply the instance of the component class.
|
|
32
34
|
*/
|
|
33
35
|
export type Exports<C> = C extends Svelte.SvelteComponent
|
|
34
36
|
? C
|
|
@@ -3,7 +3,7 @@ export const allowedOptions: string[];
|
|
|
3
3
|
/** Whether we're using Svelte >= 5. */
|
|
4
4
|
export const IS_MODERN_SVELTE: boolean;
|
|
5
5
|
/** Mount the component into the DOM. */
|
|
6
|
-
export function mount(Component: any, options: any): any
|
|
6
|
+
export function mount(Component: any, options: any): Record<string, any>;
|
|
7
7
|
/** Remove the component from the DOM. */
|
|
8
8
|
export function unmount(component: any): void;
|
|
9
9
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modern.svelte.d.ts","sourceRoot":"","sources":["../../src/core/modern.svelte.js"],"names":[],"mappings":"AAaA,2CAA2C;AAC3C,sCAOC;AAXD,uCAAuC;AACvC,uCAA2D;AAY3D,wCAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"modern.svelte.d.ts","sourceRoot":"","sources":["../../src/core/modern.svelte.js"],"names":[],"mappings":"AAaA,2CAA2C;AAC3C,sCAOC;AAXD,uCAAuC;AACvC,uCAA2D;AAY3D,wCAAwC;AACxC,yEAQC;AAED,yCAAyC;AACzC,8CAGC;AAED;;;;GAIG;AACH,kEAGC"}
|