You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by stevengill <gi...@git.apache.org> on 2017/06/26 23:33:25 UTC

[GitHub] cordova-lib pull request #569: CB-12361: added main function unit tests for ...

GitHub user stevengill opened a pull request:

    https://github.com/apache/cordova-lib/pull/569

    CB-12361: added main function unit tests for plugin add.spec.js

    work in progress. Please don't merge

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/stevengill/cordova-lib plugin-add

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/569.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #569
    
----
commit d486d473ab50420f1a79bfe88cca33d7721c26d7
Author: Steve Gill <st...@gmail.com>
Date:   2017-06-26T18:32:45Z

    CB-12361: added main function unit tests for plugin add.spec.js

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #569: CB-12361: added main function unit tests for ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-lib/pull/569


---

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


[GitHub] cordova-lib pull request #569: CB-12361: added main function unit tests for ...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/569#discussion_r135331136
  
    --- Diff: spec/cordova/plugin/add.spec.js ---
    @@ -21,16 +21,82 @@
     /* globals fail */
     
     var Q = require('q');
    -var add = require('../../../src/cordova/plugin/add');
    +var rewire = require('rewire');
    +var add = rewire('../../../src/cordova/plugin/add');
    +var plugman = require('../../../src/plugman/plugman');
    +var cordova_util = require('../../../src/cordova/util');
    +var path = require('path');
    +var fs = require('fs');
    +var config = require('../../../src/cordova/config');
    +var events = require('cordova-common').events;
    +var registry = require('../../../src/plugman/registry/registry');
    +var plugin_util = require('../../../src/cordova/plugin/util');
     
    -describe('cordova/plugin/add', function () {
    +fdescribe('cordova/plugin/add', function () {
         var projectRoot = '/some/path';
         var hook_mock;
    +    var Cfg_parser_mock = function () {};
    +    var cfg_parser_revert_mock;
    +    var plugin_info_provider_mock = function () {};
    +    var plugin_info_provider_revert_mock;
    +    var plugin_info;
    +    var package_json_mock;
    +
         beforeEach(function () {
             hook_mock = jasmine.createSpyObj('hooks runner mock', ['fire']);
             hook_mock.fire.and.returnValue(Q());
    +        Cfg_parser_mock.prototype = jasmine.createSpyObj('config parser prototype mock', ['getPlugin', 'removePlugin', 'addPlugin', 'write']);
    +        /* eslint-disable */
    +        Cfg_parser_mock.prototype.getPlugin;
    +        Cfg_parser_mock.prototype.getPlugin;
    --- End diff --
    
    good catch!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] cordova-lib pull request #569: CB-12361: added main function unit tests for ...

Posted by audreyso <gi...@git.apache.org>.
Github user audreyso commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/569#discussion_r135308470
  
    --- Diff: spec/cordova/plugin/add.spec.js ---
    @@ -21,16 +21,82 @@
     /* globals fail */
     
     var Q = require('q');
    -var add = require('../../../src/cordova/plugin/add');
    +var rewire = require('rewire');
    +var add = rewire('../../../src/cordova/plugin/add');
    +var plugman = require('../../../src/plugman/plugman');
    +var cordova_util = require('../../../src/cordova/util');
    +var path = require('path');
    +var fs = require('fs');
    +var config = require('../../../src/cordova/config');
    +var events = require('cordova-common').events;
    +var registry = require('../../../src/plugman/registry/registry');
    +var plugin_util = require('../../../src/cordova/plugin/util');
     
    -describe('cordova/plugin/add', function () {
    +fdescribe('cordova/plugin/add', function () {
         var projectRoot = '/some/path';
         var hook_mock;
    +    var Cfg_parser_mock = function () {};
    +    var cfg_parser_revert_mock;
    +    var plugin_info_provider_mock = function () {};
    +    var plugin_info_provider_revert_mock;
    +    var plugin_info;
    +    var package_json_mock;
    +
         beforeEach(function () {
             hook_mock = jasmine.createSpyObj('hooks runner mock', ['fire']);
             hook_mock.fire.and.returnValue(Q());
    +        Cfg_parser_mock.prototype = jasmine.createSpyObj('config parser prototype mock', ['getPlugin', 'removePlugin', 'addPlugin', 'write']);
    +        /* eslint-disable */
    +        Cfg_parser_mock.prototype.getPlugin;
    +        Cfg_parser_mock.prototype.getPlugin;
    --- End diff --
    
    Hi! I think you have "getPlugin" twice?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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