mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Do not clobber console.log to spy on it (#782)
This commit is contained in:
committed by
GitHub
parent
a64d459c8e
commit
47c6048d53
@@ -200,9 +200,7 @@ describe('run', () => {
|
||||
|
||||
describe('help', () => {
|
||||
it('should print out usage and help', () => {
|
||||
const logSpy = jasmine.createSpy();
|
||||
const errorSpy = jasmine.createSpy();
|
||||
run.__set__({ console: { log: logSpy, error: errorSpy } });
|
||||
spyOn(console, 'log');
|
||||
|
||||
// Rewiring the process object in entirety does not work on NodeJS 12.
|
||||
// Rewiring members of process however does work
|
||||
@@ -213,7 +211,7 @@ describe('run', () => {
|
||||
run.__set__('process.argv', ['', '']);
|
||||
|
||||
run.help();
|
||||
expect(logSpy).toHaveBeenCalledWith(jasmine.stringMatching(/^Usage:/));
|
||||
expect(console.log).toHaveBeenCalledWith(jasmine.stringMatching(/^Usage:/));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user