mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-22 00:32:55 +08:00
rewire workaround for NodeJS 12 (#774)
* rewire workaround for NodeJS 12 * additional comment with a link to the underlying issue in jhnns/rewire#167
This commit is contained in:
parent
4b9e18c6b8
commit
38c6627999
@ -202,8 +202,15 @@ describe('run', () => {
|
||||
it('should print out usage and help', () => {
|
||||
const logSpy = jasmine.createSpy();
|
||||
const errorSpy = jasmine.createSpy();
|
||||
const procStub = { exit: _ => null, cwd: _ => '', argv: ['', ''] };
|
||||
run.__set__({ console: { log: logSpy, error: errorSpy }, process: procStub });
|
||||
run.__set__({ console: { log: logSpy, error: errorSpy } });
|
||||
|
||||
// Rewiring the process object in entirety does not work on NodeJS 12.
|
||||
// Rewiring members of process however does work
|
||||
// https://github.com/apache/cordova-android/issues/768
|
||||
// https://github.com/jhnns/rewire/issues/167
|
||||
run.__set__('process.exit', _ => null);
|
||||
run.__set__('process.cwd', _ => '');
|
||||
run.__set__('process.argv', ['', '']);
|
||||
|
||||
run.help();
|
||||
expect(logSpy).toHaveBeenCalledWith(jasmine.stringMatching(/^Usage:/));
|
||||
|
Loading…
Reference in New Issue
Block a user