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 4343 "prebuild" : " rm -rf dist" ,
4444 "build" : " rollup -c"
4545 },
46- "dependencies" : {
47- "jest-environment-puppeteer" : " ^8.0.0"
48- },
4946 "devDependencies" : {
50- "jest-puppeteer" : " ^8.0.0" ,
5147 "puppeteer" : " ^19.7.2" ,
5248 "rollup" : " ^3.15.0" ,
5349 "rollup-plugin-dts" : " ^5.2.0" ,
Original file line number Diff line number Diff line change 11import type { FrameWaitForFunctionOptions } from "puppeteer" ;
2- import { puppeteerConfig } from "jest-environment-puppeteer/globals" ;
32
43export type Options = FrameWaitForFunctionOptions ;
54
@@ -9,9 +8,22 @@ export const setDefaultOptions = (options: Options) => {
98 defaultOptionsValue = options ;
109} ;
1110
11+ const globalWithPuppeteerConfig = global as {
12+ puppeteerConfig ?: {
13+ launch ?: {
14+ slowMo ?: number ;
15+ } ;
16+ connect ?: {
17+ slowMo ?: number ;
18+ } ;
19+ } ;
20+ } ;
21+
1222export const getDefaultOptions = ( ) : Options => {
1323 const slowMo =
14- puppeteerConfig ?. launch ?. slowMo || puppeteerConfig ?. connect ?. slowMo || 0 ;
24+ globalWithPuppeteerConfig . puppeteerConfig ?. launch ?. slowMo ||
25+ globalWithPuppeteerConfig . puppeteerConfig ?. connect ?. slowMo ||
26+ 0 ;
1527 const defaultTimeout = defaultOptionsValue . timeout || 0 ;
1628
1729 if ( slowMo || defaultOptionsValue . timeout ) {
You can’t perform that action at this time.
0 commit comments