You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2019/07/17 01:02:04 UTC

[cordova-android] branch master updated: Do not clobber process properties with test mocks (#783)

This is an automated email from the ASF dual-hosted git repository.

raphinesse 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 997943a  Do not clobber process properties with test mocks (#783)
997943a is described below

commit 997943a1945e943cba73cec5e1142e56470f949b
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Wed Jul 17 03:01:56 2019 +0200

    Do not clobber process properties with test mocks (#783)
---
 spec/unit/run.spec.js | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/spec/unit/run.spec.js b/spec/unit/run.spec.js
index bb19a4e..61a843c 100644
--- a/spec/unit/run.spec.js
+++ b/spec/unit/run.spec.js
@@ -201,14 +201,7 @@ describe('run', () => {
     describe('help', () => {
         it('should print out usage and help', () => {
             spyOn(console, 'log');
-
-            // 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', ['', '']);
+            spyOn(process, 'exit');
 
             run.help();
             expect(console.log).toHaveBeenCalledWith(jasmine.stringMatching(/^Usage:/));


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org