jest-playwright icon indicating copy to clipboard operation
jest-playwright copied to clipboard

Pass `context` to `PlaywrightEnvironment`'s parent (`RootEnv`)

Open juan-fernandez opened this issue 1 year ago • 0 comments

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

juan-fernandez avatar Sep 19 '24 11:09 juan-fernandez