@@ -6,12 +6,12 @@ declare const elem: HTMLElement
6
6
const SomeComponent = Vue . extend ( {
7
7
name : 'SomeComponent' ,
8
8
props : {
9
- foo : Number ,
10
- bar : String ,
9
+ foo : { type : Number , default : 0 } ,
10
+ bar : { type : String , default : '0' } ,
11
11
} ,
12
12
} )
13
13
14
- async function testRender ( ) {
14
+ export async function testRender ( ) {
15
15
const page = render ( { template : '<div />' } )
16
16
17
17
// single queries
@@ -27,22 +27,26 @@ async function testRender() {
27
27
// helpers
28
28
const { container, unmount, debug} = page
29
29
30
+ debug ( container )
31
+
30
32
debug ( elem ) // $ExpectType void
31
33
debug ( [ elem , elem ] , 100 , { highlight : false } ) // $ExpectType void
34
+
35
+ unmount ( )
32
36
}
33
37
34
- async function testRenderOptions ( ) {
38
+ export function testRenderOptions ( ) {
35
39
const container = document . createElement ( 'div' )
36
40
const options = { container}
37
41
render ( { template : 'div' } , options )
38
42
}
39
43
40
- async function testFireEvent ( ) {
44
+ export async function testFireEvent ( ) {
41
45
const { container} = render ( { template : 'button' } )
42
46
await fireEvent . click ( container )
43
47
}
44
48
45
- async function testDebug ( ) {
49
+ export function testDebug ( ) {
46
50
const { debug, getAllByTestId} = render ( {
47
51
render ( h ) {
48
52
return h ( 'div' , [
@@ -55,19 +59,19 @@ async function testDebug() {
55
59
debug ( getAllByTestId ( 'testid' ) )
56
60
}
57
61
58
- async function testScreen ( ) {
62
+ export async function testScreen ( ) {
59
63
render ( { template : 'button' } )
60
64
61
65
await screen . findByRole ( 'button' )
62
66
}
63
67
64
- async function testWaitFor ( ) {
68
+ export async function testWaitFor ( ) {
65
69
const { container} = render ( { template : 'button' } )
66
- fireEvent . click ( container )
70
+ await fireEvent . click ( container )
67
71
await waitFor ( ( ) => { } )
68
72
}
69
73
70
- async function testOptions ( ) {
74
+ export function testOptions ( ) {
71
75
render ( SomeComponent , {
72
76
// options for new Vue()
73
77
name : 'SomeComponent' ,
@@ -114,11 +118,20 @@ async function testOptions() {
114
118
} )
115
119
}
116
120
117
- function testConfigCallback ( ) {
121
+ export function testConfigCallback ( ) {
118
122
const ExamplePlugin : Vue . PluginFunction < never > = ( ) => { }
119
123
render ( SomeComponent , { } , ( localVue , store , router ) => {
120
124
localVue . use ( ExamplePlugin )
121
125
store . replaceState ( { foo : 'bar' } )
122
126
router . onError ( error => console . log ( error . message ) )
123
127
} )
124
128
}
129
+
130
+ /*
131
+ eslint
132
+ testing-library/prefer-explicit-assert: "off",
133
+ testing-library/no-wait-for-empty-callback: "off",
134
+ testing-library/no-debug: "off",
135
+ testing-library/prefer-screen-queries: "off",
136
+ @typescript -eslint/unbound-method: "off",
137
+ */
0 commit comments