Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getTestEnvData: () => {
const frozenCopy = {};
// Make a shallow copy only because a deep copy seems like
// overkill..
Object.keys(this._config.testEnvData).forEach(key => {
frozenCopy[key] = this._config.testEnvData[key];
}, this);
Object.freeze(frozenCopy);
return frozenCopy;
},
genMockFromModule: moduleId => this._generateMock(moduleId, true),
genMockFunction: moduleMocker.getMockFunction,
genMockFn: moduleMocker.getMockFunction,
mock: moduleId => {
this._explicitShouldMock[moduleId] = true;
return runtime;
},
/* eslint-disable */
resetModuleRegistry: () => {
const envGlobal = this._environment.global;
Object.keys(envGlobal).forEach(key => {
const globalMock = envGlobal[key];
if ((typeof globalMock === 'object' && globalMock !== null) ||
typeof globalMock === 'function') {
globalMock._isMockFunction && globalMock.mockClear();
}
});
// This isn't documented...
getTestEnvData: () => {
const frozenCopy = {};
// Make a shallow copy only because a deep copy seems like
// overkill..
Object.keys(this._config.testEnvData).forEach(key => {
frozenCopy[key] = this._config.testEnvData[key];
}, this);
Object.freeze(frozenCopy);
return frozenCopy;
},
genMockFromModule: moduleId => this._generateMock(moduleId, true),
genMockFunction: moduleMocker.getMockFunction,
genMockFn: moduleMocker.getMockFunction,
mock: moduleId => {
this._explicitShouldMock[moduleId] = true;
return runtime;
},
/* eslint-disable */
resetModuleRegistry: () => {
const envGlobal = this._environment.global;
Object.keys(envGlobal).forEach(key => {
const globalMock = envGlobal[key];
if ((typeof globalMock === 'object' && globalMock !== null) ||
typeof globalMock === 'function') {
globalMock._isMockFunction && globalMock.mockClear();