[ 
https://issues.apache.org/jira/browse/CB-12361?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16123708#comment-16123708
 ] 

ASF GitHub Bot commented on CB-12361:
-------------------------------------

Github user stevengill commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/577#discussion_r132742737
  
    --- Diff: spec/cordova/platform/list.spec.js ---
    @@ -0,0 +1,75 @@
    +/**
    +    Licensed to the Apache Software Foundation (ASF) under one
    +    or more contributor license agreements.  See the NOTICE file
    +    distributed with this work for additional information
    +    regarding copyright ownership.  The ASF licenses this file
    +    to you under the Apache License, Version 2.0 (the
    +    "License"); you may not use this file except in compliance
    +    with the License.  You may obtain a copy of the License at
    +    http://www.apache.org/licenses/LICENSE-2.0
    +    Unless required by applicable law or agreed to in writing,
    +    software distributed under the License is distributed on an
    +    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    +    KIND, either express or implied.  See the License for the
    +    specific language governing permissions and limitations
    +    under the License.
    +*/
    +
    +var events = require('cordova-common').events;
    +var Q = require('q');
    +var rewire = require('rewire');
    +var platform_list = rewire('../../../src/cordova/platform/list');
    +var platform_metadata = require('../../../src/cordova/platform_metadata');
    +var cordova_util = require('../../../src/cordova/util');
    +var fail;
    +
    +describe('cordova/platform/list', function () {
    +    var hooks_mock;
    +    var projectRoot = '/some/path';
    +
    +    beforeEach(function () {
    +        hooks_mock = jasmine.createSpyObj('hooksRunner mock', ['fire']);
    +        hooks_mock.fire.and.returnValue(Q());
    +        spyOn(cordova_util, 
'getInstalledPlatformsWithVersions').and.callThrough();
    +        spyOn(events, 'emit');
    +        spyOn(platform_metadata, 'save');
    +        spyOn(cordova_util, 'requireNoCache').and.returnValue({});
    +    });
    +
    +    it('should fire the before_platform_ls hook', function () {
    +        platform_list(hooks_mock, projectRoot, {save: true});
    +        expect(hooks_mock.fire).toHaveBeenCalledWith('before_platform_ls', 
Object({ save: true }));
    +    });
    +
    +    it('should file the after_platform_ls hook', function (done) {
    --- End diff --
    
    type. Should be fire


> Speed up cordova-lib tests
> --------------------------
>
>                 Key: CB-12361
>                 URL: https://issues.apache.org/jira/browse/CB-12361
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-lib
>            Reporter: Steve Gill
>            Assignee: Steve Gill
>              Labels: cordova-next
>
> * Split out e2e tests into own folder
> * stub i/o and network requests
> * use local fixtures when possible & makes sense



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to