rm monkey patch warnings
This commit is contained in:
@@ -874,44 +874,4 @@ describe('Env', function() {
|
||||
}).toThrowError('Jasmine cannot be configured via Env in parallel mode');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Warning about monkey patching', function() {
|
||||
afterEach(function() {
|
||||
// deprecateMonkeyPatching() uses jasmine.getEnv(), not the env from
|
||||
// this suite. Clean it up so we don't leak event listeners.
|
||||
jasmineUnderTest.getEnv().cleanup_();
|
||||
privateUnderTest.currentEnv_ = null;
|
||||
});
|
||||
|
||||
const names = [
|
||||
'describe',
|
||||
'xdescribe',
|
||||
'fdescribe',
|
||||
'it',
|
||||
'xit',
|
||||
'fit',
|
||||
'beforeEach',
|
||||
'afterEach',
|
||||
'beforeAll',
|
||||
'afterAll'
|
||||
];
|
||||
|
||||
for (const name of names) {
|
||||
it(`warns if Env#${name} is monkey patched`, function() {
|
||||
spyOn(console, 'error');
|
||||
const patch = {};
|
||||
env[name] = patch;
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
expect(console.error).toHaveBeenCalledOnceWith(
|
||||
jasmine.stringContaining('DEPRECATION: Monkey patching detected.')
|
||||
);
|
||||
// eslint-disable-next-line no-console
|
||||
expect(console.error).toHaveBeenCalledOnceWith(
|
||||
jasmine.stringContaining('EnvSpec.js')
|
||||
);
|
||||
expect(env[name]).toBe(patch);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user