@jest/environment
Advanced tools
Comparing version 26.6.2 to 27.0.0-next.0
@@ -11,5 +11,3 @@ /** | ||
import type { Circus, Config, Global } from '@jest/types'; | ||
import jestMock = require('jest-mock'); | ||
declare type JestMockFn = typeof jestMock.fn; | ||
declare type JestMockSpyOn = typeof jestMock.spyOn; | ||
import type { fn as JestMockFn, spyOn as JestMockSpyOn, ModuleMocker } from 'jest-mock'; | ||
export declare type EnvironmentContext = Partial<{ | ||
@@ -20,3 +18,3 @@ console: Console; | ||
}>; | ||
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], global: Global.Global, jest?: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown; | ||
export declare type ModuleWrapper = (this: Module['exports'], module: Module, exports: Module['exports'], require: Module['require'], __dirname: string, __filename: Module['filename'], jest?: Jest, ...extraGlobals: Array<Global.Global[keyof Global.Global]>) => unknown; | ||
export declare class JestEnvironment { | ||
@@ -27,3 +25,3 @@ constructor(config: Config.ProjectConfig, context?: EnvironmentContext); | ||
fakeTimersModern: ModernFakeTimers | null; | ||
moduleMocker: jestMock.ModuleMocker | null; | ||
moduleMocker: ModuleMocker | null; | ||
/** | ||
@@ -41,8 +39,2 @@ * @deprecated implement getVmContext instead | ||
/** | ||
* Provides a way to add Jasmine-compatible matchers into your Jest context. | ||
* | ||
* @deprecated Use `expect.extend` instead | ||
*/ | ||
addMatchers(matchers: Record<string, unknown>): void; | ||
/** | ||
* Advances all timers by the needed milliseconds so that only the next timeouts/intervals will run. | ||
@@ -103,3 +95,3 @@ * Optionally, you can provide steps, so it will run steps amount of next timeouts/intervals. | ||
*/ | ||
fn: JestMockFn; | ||
fn: typeof JestMockFn; | ||
/** | ||
@@ -126,3 +118,3 @@ * Given the name of a module, use the automatic mocking system to generate a | ||
*/ | ||
isMockFunction(fn: (...args: Array<any>) => unknown): fn is ReturnType<JestMockFn>; | ||
isMockFunction(fn: (...args: Array<any>) => unknown): fn is ReturnType<typeof JestMockFn>; | ||
/** | ||
@@ -169,10 +161,3 @@ * Mocks a module with an auto-mocked version when it is being required. | ||
* useful to isolate modules where local state might conflict between tests. | ||
* | ||
* @deprecated Use `jest.resetModules()` | ||
*/ | ||
resetModuleRegistry(): Jest; | ||
/** | ||
* Resets the module registry - the cache of all required modules. This is | ||
* useful to isolate modules where local state might conflict between tests. | ||
*/ | ||
resetModules(): Jest; | ||
@@ -222,9 +207,2 @@ /** | ||
/** | ||
* Executes only the macro task queue (i.e. all tasks queued by setTimeout() | ||
* or setInterval() and setImmediate()). | ||
* | ||
* @deprecated Use `jest.advanceTimersByTime()` | ||
*/ | ||
runTimersToTime(msToRun: number): void; | ||
/** | ||
* Returns the number of fake timers still left to run. | ||
@@ -257,3 +235,3 @@ */ | ||
*/ | ||
spyOn: JestMockSpyOn; | ||
spyOn: typeof JestMockSpyOn; | ||
/** | ||
@@ -293,2 +271,1 @@ * Indicates that the module system should never return a mocked version of | ||
} | ||
export {}; |
'use strict'; | ||
function _jestMock() { | ||
const data = _interopRequireDefault(require('jest-mock')); | ||
_jestMock = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : {default: obj}; | ||
} |
{ | ||
"name": "@jest/environment", | ||
"version": "26.6.2", | ||
"version": "27.0.0-next.0", | ||
"repository": { | ||
@@ -10,12 +10,16 @@ "type": "git", | ||
"license": "MIT", | ||
"main": "build/index.js", | ||
"types": "build/index.d.ts", | ||
"main": "./build/index.js", | ||
"types": "./build/index.d.ts", | ||
"exports": { | ||
".": "./build/index.js", | ||
"./package.json": "./package.json" | ||
}, | ||
"dependencies": { | ||
"@jest/fake-timers": "^26.6.2", | ||
"@jest/types": "^26.6.2", | ||
"@jest/fake-timers": "^27.0.0-next.0", | ||
"@jest/types": "^27.0.0-next.0", | ||
"@types/node": "*", | ||
"jest-mock": "^26.6.2" | ||
"jest-mock": "^27.0.0-next.0" | ||
}, | ||
"engines": { | ||
"node": ">= 10.14.2" | ||
"node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" | ||
}, | ||
@@ -25,3 +29,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4c46930615602cbf983fb7e8e82884c282a624d5" | ||
"gitHead": "4f77c70602cab8419794f10fa39510f13baafef8" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12148
260
2
+ Added@jest/fake-timers@27.5.1(transitive)
+ Added@jest/types@27.5.1(transitive)
+ Added@sinonjs/fake-timers@8.1.0(transitive)
+ Added@types/yargs@16.0.9(transitive)
+ Addedansi-styles@5.2.0(transitive)
+ Addedci-info@3.9.0(transitive)
+ Addedjest-message-util@27.5.1(transitive)
+ Addedjest-mock@27.5.1(transitive)
+ Addedjest-util@27.5.1(transitive)
+ Addedpretty-format@27.5.1(transitive)
- Removed@jest/fake-timers@26.6.2(transitive)
- Removed@jest/types@26.6.2(transitive)
- Removed@sinonjs/fake-timers@6.0.1(transitive)
- Removed@types/yargs@15.0.19(transitive)
- Removedci-info@2.0.0(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedjest-message-util@26.6.2(transitive)
- Removedjest-mock@26.6.2(transitive)
- Removedjest-util@26.6.2(transitive)
- Removedpretty-format@26.6.2(transitive)
Updated@jest/types@^27.0.0-next.0
Updatedjest-mock@^27.0.0-next.0