cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevengill <...@git.apache.org>
Subject [GitHub] cordova-lib pull request #510: Fixjasmine : CB:12018 - updating tests in cor...
Date Wed, 11 Jan 2017 02:30:17 GMT
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


Mime
View raw message