Skip to content

Commit ed5c9eb

Browse files
committed
fix: remove cycle dependency
1 parent c6d19db commit ed5c9eb

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

packages/expect-puppeteer/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@
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",

packages/expect-puppeteer/src/options.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type { FrameWaitForFunctionOptions } from "puppeteer";
2-
import { puppeteerConfig } from "jest-environment-puppeteer/globals";
32

43
export 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+
1222
export 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) {

0 commit comments

Comments
 (0)