Closed Gorodb closed 2 years ago
After updating jest-playwright-preset to version 2.0.0 and jest to version 28.1.3 I got the error: (node:28292) UnhandledPromiseRejectionWarning: ReferenceError: page is not defined
(node:28292) UnhandledPromiseRejectionWarning: ReferenceError: page is not defined
Environment:
Jest configuration (jest.config.js):
module.exports = { preset: 'jest-playwright-preset', testEnvironment: "jest-allure-circus", testRunner: "jest-circus/runner", testMatch: ['**/__tests__/**/*.+(ts|js)', '**/?(*.)+(spec|test).+(ts|js)'], testTimeout: 30000, transform: { '^.+\\.ts$': 'ts-jest', }, verbose: true, setupFilesAfterEnv: [ './customMatchers.ts', './config.ts', ], };
stylelint:
"stylelint": { "plugins": [ "eslint-plugin-jest", "eslint-plugin-playwright" ], "extends": [ "plugin:playwright/jest-playwright" ] },
tsconfig.json
{ "compilerOptions": { "target": "ESNext", "strict": true, "noEmit": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "module": "commonjs", "sourceMap": true, "types": [ "jest-playwright-preset", "@types/jest", "@types/node" ] }, "exclude": [ "node_modules" ] }
It is because of testEnvironment: "jest-allure-circus"
testEnvironment: "jest-allure-circus"
After updating jest-playwright-preset to version 2.0.0 and jest to version 28.1.3 I got the error:
(node:28292) UnhandledPromiseRejectionWarning: ReferenceError: page is not defined
Environment:
Jest configuration (jest.config.js):
stylelint:
tsconfig.json