vendredi 20 novembre 2015

Karma + Jasmine reporting 0 tests run when there are tests

I'm trying to run some Jasmine tests in Karma but the tests are failing because it's saying that it ran 0 of 0 tests. Can someone tell me what I'm doing wrong?

The async request mock fires and hits the callback. Even when I go to the debugger, it says 2 tests completed in the debugger, but failing in the console. What gives?

describe('User Info Tests:', function () {
    describe('Fetch User Info:', function () {
        it("User Name should match", function(done) { 
            // mock async request
            getUserProfile(1, 2, function (userProfile) {
                var match = userProfile.displayName === 'Unit Test User';
                expect(match).toBeTruthy();                    
                done();
            }, function (msg) {
                done();
                throw msg;
            });                 
        });            
    });
});

See the screenshot below of the debug console of the tests running. You will see the tests ran with a status of SUCCESS.

Test debug console

Aucun commentaire:

Enregistrer un commentaire