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 78F7F200C09 for ; Wed, 11 Jan 2017 03:30:24 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 77B9B160B4D; Wed, 11 Jan 2017 02:30:24 +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 C44B7160B3D for ; Wed, 11 Jan 2017 03:30:23 +0100 (CET) Received: (qmail 37688 invoked by uid 500); 11 Jan 2017 02:30:18 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 36953 invoked by uid 99); 11 Jan 2017 02:30:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2017 02:30:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id DB5CDDFEEF; Wed, 11 Jan 2017 02:30:17 +0000 (UTC) From: stevengill To: dev@cordova.apache.org Reply-To: dev@cordova.apache.org References: In-Reply-To: Subject: [GitHub] cordova-lib pull request #510: Fixjasmine : CB:12018 - updating tests in cor... Content-Type: text/plain Message-Id: <20170111023017.DB5CDDFEEF@git1-us-west.apache.org> Date: Wed, 11 Jan 2017 02:30:17 +0000 (UTC) archived-at: Wed, 11 Jan 2017 02:30:24 -0000 Github user stevengill commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/510#discussion_r95501387 --- Diff: cordova-lib/spec-plugman/create.spec.js --- @@ -35,46 +35,42 @@ describe( 'create plugin', function() { existsSync, mkdir, writeFileSync; - function createPromise( f ) { - f.then( function() { done = true; }, function(err) { done = err; } ); - } + beforeEach( function() { - existsSync = spyOn( fs, 'existsSync' ).andReturn( false ); - mkdir = spyOn( shell, 'mkdir' ).andReturn( true ); + existsSync = spyOn( fs, 'existsSync' ).and.returnValue( false ); + mkdir = spyOn( shell, 'mkdir' ).and.returnValue( true ); writeFileSync = spyOn( fs, 'writeFileSync' ); done = false; }); - it( 'should be successful', function() { - runs(function() { - createPromise( create( 'name', 'org.plugin.id', '0.0.0', '.', [] ) ); - }); - waitsFor(function() { return done; }, 'create promise never resolved', 500); - runs(function() { - expect( done ).toBe( true ); - expect( writeFileSync.calls.length ).toEqual( 2 ); + it( 'Test 002 : should be successful', function(done) { + create('name', 'org.plugin.id', '0.0.0', '.', []) + .then(function(result) { + expect( writeFileSync.calls.count() ).toEqual( 2 ); + done(); + }).fail(function err(errMsg) { + done(); --- End diff -- maybe add a expect errMsg to be undefined here --- 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