mardi 22 septembre 2015

How can I use Jasmine with requirejs?

I'm unable to create describe blocks from inside a require call.

In my spec file, I have the following:

require(['/js/lib/twgl-full.min'],
    function(twgl){
        describe('twgl', function(){
            it('exists',function(){
                expect(twgl).toBeDefined();
            });
        });
});

While the spec file is being read, and twgl is being recognized in other scripts through an identical require call, I'm unable to get jasmine to recognize my describe statements from inside the require block. I've been banging my head against this problem for almost the entire day. What can I do to fix this?

Aucun commentaire:

Enregistrer un commentaire