diff --git a/.gitignore b/.gitignore index 0bf7fd5..904de0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store +.npmrc node_modules **.tgz diff --git a/package.json b/package.json index 775a6b2..6ff4908 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jest-mock-console", - "version": "1.2.0", + "version": "1.2.1", "description": "Jest utility to mock the console", "main": "index.js", "types": "index.d.ts", @@ -43,6 +43,9 @@ "ts-jest26": "npm:ts-jest@^26.5.6", "typescript": "^4.2.4" }, + "publishConfig": { + "registry": "https://registry.npmjs.org/" + }, "repository": { "type": "git", "url": "https://github.com/bpedersen/jest-mock-console.git" diff --git a/src/setupTestFramework.js b/src/setupTestFramework.js index e1b5d5e..e1aa96e 100644 --- a/src/setupTestFramework.js +++ b/src/setupTestFramework.js @@ -1,9 +1,9 @@ -const originalDescribe = describe; - // Check to see if version before 27 where jasmine is default const jestVersion = require("jest/package.json").version; const [majorVersion] = jestVersion.split("."); if (majorVersion < 27) { + const originalDescribe = jasmine.getEnv().describe; + jasmine.getEnv().describe = ( description, specDefinitions, @@ -26,6 +26,8 @@ if (majorVersion < 27) { ); }; } else { + const originalDescribe = describe; + describe = (description, specDefinitions) => { let $jestMockConsoleOriginal; const injectedSpecDefinition = (...specArgs) => {