File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
packages/expect-puppeteer Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 43
43
"prebuild" : " rm -rf dist" ,
44
44
"build" : " rollup -c"
45
45
},
46
- "dependencies" : {
47
- "jest-environment-puppeteer" : " ^8.0.0"
48
- },
49
46
"devDependencies" : {
50
- "jest-puppeteer" : " ^8.0.0" ,
51
47
"puppeteer" : " ^19.7.2" ,
52
48
"rollup" : " ^3.15.0" ,
53
49
"rollup-plugin-dts" : " ^5.2.0" ,
Original file line number Diff line number Diff line change 1
1
import type { FrameWaitForFunctionOptions } from "puppeteer" ;
2
- import { puppeteerConfig } from "jest-environment-puppeteer/globals" ;
3
2
4
3
export type Options = FrameWaitForFunctionOptions ;
5
4
@@ -9,9 +8,22 @@ export const setDefaultOptions = (options: Options) => {
9
8
defaultOptionsValue = options ;
10
9
} ;
11
10
11
+ const globalWithPuppeteerConfig = global as {
12
+ puppeteerConfig ?: {
13
+ launch ?: {
14
+ slowMo ?: number ;
15
+ } ;
16
+ connect ?: {
17
+ slowMo ?: number ;
18
+ } ;
19
+ } ;
20
+ } ;
21
+
12
22
export const getDefaultOptions = ( ) : Options => {
13
23
const slowMo =
14
- puppeteerConfig ?. launch ?. slowMo || puppeteerConfig ?. connect ?. slowMo || 0 ;
24
+ globalWithPuppeteerConfig . puppeteerConfig ?. launch ?. slowMo ||
25
+ globalWithPuppeteerConfig . puppeteerConfig ?. connect ?. slowMo ||
26
+ 0 ;
15
27
const defaultTimeout = defaultOptionsValue . timeout || 0 ;
16
28
17
29
if ( slowMo || defaultOptionsValue . timeout ) {
You can’t perform that action at this time.
0 commit comments