Skip to content

Commit

Permalink
Remove JEST environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Mar 2, 2019
1 parent daa6ca6 commit d372c49
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 32 deletions.
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ module.exports = {
globals: {
__external__: false,
__global__: false,
__jest__: false,
__non_webpack_module__: false,
__non_webpack_require__: false,
__shared__: false,
jest: false,
WebAssembly: false
},
parser: "eslint-plugin-import/memo-parser",
Expand Down
11 changes: 2 additions & 9 deletions esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ const esmModule = new Module(id)
esmModule.filename = filename
esmModule.parent = parent

let jestObject

if (typeof jest === "object" && jest !== null &&
global.jest !== jest) {
jestObject = jest
}

function getNativeSource(thePath) {
let result

Expand All @@ -79,7 +72,7 @@ function has(object, name) {
}

function loadESM() {
compiledESM(require, esmModule, jestObject, shared)
compiledESM(require, esmModule, shared)
return esmModule.exports
}

Expand Down Expand Up @@ -130,7 +123,7 @@ if (nativeContent !== "") {

const script = new Script(
"var __global__ = this;" +
"(function (require, module, __jest__, __shared__) { " +
"(function (require, module, __shared__) { " +
content +
"\n});",
scriptOptions
Expand Down
2 changes: 0 additions & 2 deletions src/constant/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import isElectronRenderer from "../env/is-electron-renderer.js"
import isEval from "../env/is-eval.js"
import isInternal from "../env/is-internal.js"
import isJasmine from "../env/is-jasmine.js"
import isJest from "../env/is-jest.js"
import isNdb from "../env/is-ndb.js"
import isNyc from "../env/is-nyc.js"
import isPreloaded from "../env/is-preloaded.js"
Expand All @@ -35,7 +34,6 @@ setDeferred(ENV, "FLAGS", getFlags)
setDeferred(ENV, "HAS_INSPECTOR", hasInspector)
setDeferred(ENV, "INTERNAL", isInternal)
setDeferred(ENV, "JASMINE", isJasmine)
setDeferred(ENV, "JEST", isJest)
setDeferred(ENV, "NDB", isNdb)
setDeferred(ENV, "NYC", isNyc)
setDeferred(ENV, "OPTIONS", getOptions)
Expand Down
13 changes: 0 additions & 13 deletions src/env/is-jest.js

This file was deleted.

8 changes: 2 additions & 6 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import staticWrap from "./module/static/wrap.js"
import staticWrapper from "./module/static/wrapper.js"

const {
ELECTRON,
JEST
ELECTRON
} = ENV

const Module = maskFunction(function (id, parent) {
Expand All @@ -46,6 +45,7 @@ const Module = maskFunction(function (id, parent) {

const _extensions = { __proto__: null }

Module._cache = __non_webpack_require__.cache
Module._extensions = _extensions
Module._findPath = staticFindPath
Module._initPaths = staticInitPaths
Expand Down Expand Up @@ -77,10 +77,6 @@ prototype.require = req
assign(_extensions, RealModule._extensions)
safeDefaultProperties(Module, RealModule)

if (JEST) {
Module._cache = __non_webpack_require__.cache
}

if (! Array.isArray(Module.globalPaths)) {
Module._initPaths()
}
Expand Down

0 comments on commit d372c49

Please sign in to comment.