cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jan...@apache.org
Subject [cordova-windows] 04/05: avoid crosspolution in tests that rely on ENV vars (uh, ugly)
Date Thu, 15 Feb 2018 15:29:55 GMT
This is an automated email from the ASF dual-hosted git repository.

janpio pushed a commit to branch janpio-MSBUILDDIR_2
in repository https://gitbox.apache.org/repos/asf/cordova-windows.git

commit 8b535d8a9ddd7ea798097f9e9d66e1fd701bd8ea
Author: Jan Piotrowski <piotrowski@gmail.com>
AuthorDate: Thu Feb 15 13:00:38 2018 +0100

    avoid crosspolution in tests that rely on ENV vars (uh, ugly)
---
 spec/unit/build.spec.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index ad25c99..f9f55fa 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -376,6 +376,9 @@ describe('run method', function () {
         var msBuildBinPath = path.join(customMSBuildPath, 'MSBuild/15.0/Bin');
         var customMSBuildVersion = '15.0';
         process.env.VSINSTALLDIR = customMSBuildPath;
+        // avoid crosspollution with MSBUILDDIR
+        var backupMSBUILDDIR = process.env.MSBUILDDIR;
+        delete process.env.MSBUILDDIR;
 
         spyOn(MSBuildTools, 'getMSBuildToolsAt')
             .and.returnValue(Q({
@@ -392,6 +395,7 @@ describe('run method', function () {
                 expect(fail).not.toHaveBeenCalled();
                 expect(MSBuildTools.getMSBuildToolsAt).toHaveBeenCalledWith(msBuildBinPath);
                 delete process.env.VSINSTALLDIR;
+                process.env.MSBUILDDIR = backupMSBUILDDIR;
                 done();
             });
     });
@@ -400,6 +404,9 @@ describe('run method', function () {
         var msBuildBinPath = path.join('/some/path', 'MSBuild/15.0/Bin');
         var customMSBuildVersion = '15.0';
         process.env.MSBUILDDIR = msBuildBinPath;
+        // avoid crosspollution with VSINSTALLDIR
+        var backupVSINSTALLDIR = process.env.VSINSTALLDIR;
+        delete process.env.VSINSTALLDIR;
 
         spyOn(MSBuildTools, 'getMSBuildToolsAt')
             .and.returnValue(Q({
@@ -416,6 +423,7 @@ describe('run method', function () {
                 expect(fail).not.toHaveBeenCalled();
                 expect(MSBuildTools.getMSBuildToolsAt).toHaveBeenCalledWith(msBuildBinPath);
                 delete process.env.MSBUILDDIR;
+                process.env.VSINSTALLDIR = backupVSINSTALLDIR;
                 done();
             });
     });

-- 
To stop receiving notification emails like this one, please contact
janpio@apache.org.

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


Mime
View raw message