[Fixed]-Unable to inject factory into test suite using Karma/Jasmine

1👍

The reason your test doesn’t work is because you haven’t actually tested anything. Within that describe function you need to actually put the test in an it function. Something like below:

describe('projectInfoStorage factory', function() {
    var projectInfoStorage;

    beforeEach(angular.mock.module('tablebrowser'));

    beforeEach(inject(function(_projectInfoStorage_) {
        projectInfoStorage = _projectInfoStorage_;
    }));

    it('will test factory', function() {
        expect(true).toBeTruthy();
    }
});

You need to build your tests with these in order to test something.

👤Jon

Leave a comment