@testing-library/svelte 3.1.1 → 3.1.2
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 +2 -2
- package/types/index.d.ts +25 -7
- package/CHANGELOG.md +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testing-library/svelte",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Simple and complete Svelte testing utilities that encourage good testing practices.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/testing-library/svelte-testing-library/issues"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">= 10"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"testing",
|
package/types/index.d.ts
CHANGED
|
@@ -3,11 +3,18 @@
|
|
|
3
3
|
// Definitions by: Rahim Alwer <https://github.com/mihar-22>
|
|
4
4
|
|
|
5
5
|
import {queries, Queries, BoundFunction, EventType} from '@testing-library/dom'
|
|
6
|
-
import {
|
|
6
|
+
import { SvelteComponentTyped } from 'svelte/types/runtime'
|
|
7
7
|
|
|
8
8
|
export * from '@testing-library/dom'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
export interface SvelteComponentOptions<P extends Record<string, any> = any> {
|
|
11
|
+
target?: HTMLElement
|
|
12
|
+
anchor?: string
|
|
13
|
+
props?: P
|
|
14
|
+
context?: any
|
|
15
|
+
hydrate?: boolean
|
|
16
|
+
intro?: boolean
|
|
17
|
+
}
|
|
11
18
|
|
|
12
19
|
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
|
13
20
|
|
|
@@ -15,30 +22,41 @@ type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
|
|
|
15
22
|
* Render a Component into the Document.
|
|
16
23
|
*/
|
|
17
24
|
export type RenderResult<Q extends Queries = typeof queries> = {
|
|
18
|
-
container:
|
|
25
|
+
container: Element
|
|
19
26
|
component: SvelteComponent
|
|
20
|
-
|
|
27
|
+
component: SvelteComponentTyped
|
|
28
|
+
debug: (el?: Element | DocumentFragment) => void
|
|
21
29
|
rerender: (options: SvelteComponentOptions) => void
|
|
22
30
|
unmount: () => void
|
|
23
31
|
} & { [P in keyof Q]: BoundFunction<Q[P]> }
|
|
24
32
|
|
|
25
33
|
export interface RenderOptions<Q extends Queries = typeof queries> {
|
|
26
|
-
container?:
|
|
34
|
+
container?: Element
|
|
27
35
|
queries?: Q
|
|
28
36
|
}
|
|
29
37
|
|
|
30
38
|
export function render(
|
|
31
|
-
component:
|
|
39
|
+
component: SvelteComponentTyped,
|
|
32
40
|
componentOptions?: SvelteComponentOptions,
|
|
33
41
|
renderOptions?: Omit<RenderOptions, 'queries'>
|
|
34
42
|
): RenderResult
|
|
35
43
|
|
|
36
44
|
export function render<Q extends Queries>(
|
|
37
|
-
component:
|
|
45
|
+
component: SvelteComponentTyped,
|
|
38
46
|
componentOptions?: SvelteComponentOptions,
|
|
39
47
|
renderOptions?: RenderOptions<Q>,
|
|
40
48
|
): RenderResult<Q>
|
|
41
49
|
|
|
50
|
+
export function render<
|
|
51
|
+
P extends Record<string, any> = any,
|
|
52
|
+
E extends Record<string, any> = any,
|
|
53
|
+
S extends Record<string, any> = any
|
|
54
|
+
>(
|
|
55
|
+
component: SvelteComponentTyped<P, E, S>,
|
|
56
|
+
componentOptions?: SvelteComponentOptions<P>,
|
|
57
|
+
renderOptions?: Omit<RenderOptions, "queries">
|
|
58
|
+
): RenderResult;
|
|
59
|
+
|
|
42
60
|
/**
|
|
43
61
|
* Unmounts trees that were mounted with render.
|
|
44
62
|
*/
|