Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0E7D920049C for ; Fri, 11 Aug 2017 19:36:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0CC6D16DAEF; Fri, 11 Aug 2017 17:36:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5239316DAEE for ; Fri, 11 Aug 2017 19:36:09 +0200 (CEST) Received: (qmail 86925 invoked by uid 500); 11 Aug 2017 17:36:08 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 86913 invoked by uid 99); 11 Aug 2017 17:36:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Aug 2017 17:36:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E8931C00E2 for ; Fri, 11 Aug 2017 17:36:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3UKGNltlshXv for ; Fri, 11 Aug 2017 17:36:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 9D6135F6C2 for ; Fri, 11 Aug 2017 17:36:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 283AAE002C for ; Fri, 11 Aug 2017 17:36:06 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 84E582419D for ; Fri, 11 Aug 2017 17:36:00 +0000 (UTC) Date: Fri, 11 Aug 2017 17:36:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-12361) Speed up cordova-lib tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 11 Aug 2017 17:36:10 -0000 [ 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-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org