You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2019/07/12 06:10:03 UTC
[cordova-android] branch master updated: rewire workaround for
NodeJS 12 (#774)
This is an automated email from the ASF dual-hosted git repository.
brodybits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new 38c6627 rewire workaround for NodeJS 12 (#774)
38c6627 is described below
commit 38c66279999325b850c595f7dedd4f5be188cd80
Author: Norman Breau <no...@normanbreau.com>
AuthorDate: Fri Jul 12 03:09:57 2019 -0300
rewire workaround for NodeJS 12 (#774)
* rewire workaround for NodeJS 12
* additional comment with a link to the underlying issue in jhnns/rewire#167
---
spec/unit/run.spec.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/spec/unit/run.spec.js b/spec/unit/run.spec.js
index 836b5b2..406f25b 100644
--- a/spec/unit/run.spec.js
+++ b/spec/unit/run.spec.js
@@ -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:/));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org