You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/12/12 23:54:40 UTC

[cordova-lib] branch master updated: fixed failing test

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

steven pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-lib.git


The following commit(s) were added to refs/heads/master by this push:
     new 8bec2be  fixed failing test
8bec2be is described below

commit 8bec2be3ef3236952e76228b2e8c6c359d52e6dd
Author: Steve Gill <st...@gmail.com>
AuthorDate: Tue Dec 12 15:54:29 2017 -0800

    fixed failing test
---
 spec/cordova/platform/addHelper.spec.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/spec/cordova/platform/addHelper.spec.js b/spec/cordova/platform/addHelper.spec.js
index aa83fe0..4b84d40 100644
--- a/spec/cordova/platform/addHelper.spec.js
+++ b/spec/cordova/platform/addHelper.spec.js
@@ -69,6 +69,7 @@ describe('cordova/platform/addHelper', function () {
         prepare_revert_mock = platform_addHelper.__set__('prepare', prepare_mock);
         spyOn(shell, 'mkdir');
         spyOn(fs, 'existsSync').and.returnValue(false);
+        spyOn(fs, 'readFileSync');
         spyOn(fs, 'writeFileSync');
         spyOn(cordova_util, 'projectConfig').and.returnValue(path.join(projectRoot, 'config.xml'));
         spyOn(cordova_util, 'isDirectory').and.returnValue(false);
@@ -284,7 +285,7 @@ describe('cordova/platform/addHelper', function () {
 
             describe('if the project contains a package.json', function () {
                 it('should write out the platform just added/updated to the cordova.platforms property of package.json', function (done) {
-                    spyOn(fs, 'readFileSync').and.returnValue('file');
+                    fs.readFileSync.and.returnValue('file');
                     fs.existsSync.and.callFake(function (filePath) {
                         if (path.basename(filePath) === 'package.json') {
                             return true;
@@ -310,6 +311,7 @@ describe('cordova/platform/addHelper', function () {
                     fs.existsSync.and.callFake(function (filePath) {
                         return path.basename(filePath) === 'package.json';
                     });
+                    fs.readFileSync.and.returnValue('{}');
                     platform_addHelper('add', hooks_mock, projectRoot, ['ios'], {save: true, restoring: true}).then(function () {
                         expect(platform_addHelper.getVersionFromConfigFile).not.toHaveBeenCalled();
                         expect(fs.writeFileSync).toHaveBeenCalled();

-- 
To stop receiving notification emails like this one, please contact
['"commits@cordova.apache.org" <co...@cordova.apache.org>'].

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