Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Importing globalSetup for Authentication session setup errors. #684

@andrewgremlich

Description

@andrewgremlich

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,
     },
   },
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesSomething is wrong with type definition

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions