Description
I am trying to share authentication state in my jest test. I am following the documentation here in the readme. When I import globalSetup from jest-playwright-preset, I am getting an error that says "Module '"jest-playwright-preset"' has no exported member 'globalSetup'".
Note I am using TypeScript.
To Reproduce
Import globalSetup from jest-playwright-preset. Typescript intellisense will give an error saying there is no exported member named globalSetup.
Expected behavior
Be able to import globalSetup so that I can share authentication state between tests.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Linux Manjaro
- Playwright version = 1.9.2
- jest-playwright version = 1.4.3
Jest configuration (Either in the package.json > jest or in the jest.config.js):
{
displayName: "Recover UI Automation",
preset: "jest-playwright-preset",
setupFilesAfterEnv: ["<rootDir>/src/jest.setupFilesAfterEnv.ts"],
globalSetup: "<rootDir>/src/jest.setup.ts",
transform: {
"^.+\\.(ts)$": "ts-jest",
},
testEnvironmentOptions: {
"jest-playwright": {
browsers: ["chromium"],
launchOptions: {
slowMo: 500,
headless: false,
},
},
}