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

Pass context to PlaywrightEnvironment's parent (RootEnv) #820

Open
juan-fernandez wants to merge 1 commit intoplaywright-community:mainfrom
juan-fernandez:juan-fernandez/pass-context-to-parent
Open

Pass context to PlaywrightEnvironment's parent (RootEnv) #820
juan-fernandez wants to merge 1 commit intoplaywright-community:mainfrom
juan-fernandez:juan-fernandez/pass-context-to-parent

Conversation

@juan-fernandez
Copy link
Copy Markdown

Fixes #819

This is how jest recommends creating your own test environment (jest docs):

// my-custom-environment
const NodeEnvironment = require('jest-environment-node').TestEnvironment;

class CustomEnvironment extends NodeEnvironment {
  constructor(config, context) {
    super(config, context); // see context here
    console.log(config.globalConfig);
    console.log(config.projectConfig);
    this.testPath = context.testPath;
    this.docblockPragmas = context.docblockPragmas;
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass context to the parent of PlaywrightEnvironment

1 participant