File tree 4 files changed +14
-13
lines changed
4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 50
50
"jest-serializer-ansi" : " ^1.0.3" ,
51
51
"jest-watch-select-projects" : " ^2.0.0" ,
52
52
"jsdom" : " ^16.2.2" ,
53
- "kcd-scripts" : " ^6.0 .0"
53
+ "kcd-scripts" : " ^6.2 .0"
54
54
},
55
55
"eslintConfig" : {
56
56
"extends" : " ./node_modules/kcd-scripts/eslint.js" ,
Original file line number Diff line number Diff line change 8
8
waitFor ,
9
9
waitForElementToBeRemoved ,
10
10
MatcherOptions ,
11
- } from '../index '
11
+ } from '@testing-library/dom '
12
12
13
13
const {
14
14
getByText,
@@ -162,4 +162,7 @@ async function testWaitFors() {
162
162
} )
163
163
await waitForElementToBeRemoved ( getByText ( element , 'apple' ) )
164
164
await waitForElementToBeRemoved ( getAllByText ( element , 'apple' ) )
165
+
166
+ // $ExpectError
167
+ await waitFor ( async ( ) => { } )
165
168
}
Original file line number Diff line number Diff line change 9
9
"strictNullChecks" : true ,
10
10
"strictFunctionTypes" : true ,
11
11
"noEmit" : true ,
12
-
13
- // If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
14
- // If the library is global (cannot be imported via `import` or `require`), leave this out.
15
- "baseUrl" : " ."
12
+ "baseUrl" : " ." ,
13
+ "paths" : {"@testing-library/dom" : [" ." ]}
16
14
}
17
15
}
Original file line number Diff line number Diff line change 1
1
export interface waitForOptions {
2
- container ?: HTMLElement ;
3
- timeout ?: number ;
4
- interval ?: number ;
5
- mutationObserverOptions ?: MutationObserverInit ;
2
+ container ?: HTMLElement
3
+ timeout ?: number
4
+ interval ?: number
5
+ mutationObserverOptions ?: MutationObserverInit
6
6
}
7
7
8
8
export function waitFor < T > (
9
- callback : ( ) => T ,
10
- options ?: waitForOptions ,
11
- ) : Promise < T > ;
9
+ callback : ( ) => T extends Promise < any > ? never : T ,
10
+ options ?: waitForOptions ,
11
+ ) : Promise < T >
You can’t perform that action at this time.
0 commit comments