From 471d2ff843013c409e44ec3a6cf3cf46afe79657 Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Thu, 27 Jun 2019 16:51:38 -0700 Subject: [PATCH 1/2] Update custom environment docs --- docs/Configuration.md | 6 +++--- website/versioned_docs/version-24.8/Configuration.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index bc9f585c63f4..859bdaf45868 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -875,10 +875,10 @@ Example: const NodeEnvironment = require('jest-environment-node'); class CustomEnvironment extends NodeEnvironment { - constructor(config, {testPath, docblockPragmas}) { + constructor(config, context) { super(config, context); - this.testPath = testPath; - this.docblockPragmas = docblockPragmas; + this.testPath = context.testPath; + this.docblockPragmas = context.docblockPragmas; } async setup() { diff --git a/website/versioned_docs/version-24.8/Configuration.md b/website/versioned_docs/version-24.8/Configuration.md index 7d4811589185..e5627ff51da3 100644 --- a/website/versioned_docs/version-24.8/Configuration.md +++ b/website/versioned_docs/version-24.8/Configuration.md @@ -876,10 +876,10 @@ Example: const NodeEnvironment = require('jest-environment-node'); class CustomEnvironment extends NodeEnvironment { - constructor(config, {testPath, docblockPragmas}) { + constructor(config, context) { super(config, context); - this.testPath = testPath; - this.docblockPragmas = docblockPragmas; + this.testPath = context.testPath; + this.docblockPragmas = context.docblockPragmas; } async setup() { From 32f47e8d58e8007dcac848308c2bf6e8c5fcdc2d Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Thu, 27 Jun 2019 16:57:01 -0700 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 901b86ea539c..0f377ac43c15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - `[docs]` Add example to `jest.mock` for mocking ES6 modules with the `factory` parameter ([#8550](https://github.com/facebook/jest/pull/8550)) - `[docs]` Add information about using `jest.doMock` with ES6 imports ([#8573](https://github.com/facebook/jest/pull/8573)) - `[docs]` Fix variable name in custom-matcher-api code example ([#8582](https://github.com/facebook/jest/pull/8582)) +- `[docs]` Fix example used in custom environment docs ([#8617](https://github.com/facebook/jest/pull/8617)) ### Performance