Getting requirejs to work with Jasmine

后端 未结 5 1510
半阙折子戏
半阙折子戏 2020-12-04 06:52

I first want to say that I am new to RequireJS and even newer to Jasmine.

I am having some issues with the SpecRunner and require JS. I have been following the tut

5条回答
  •  被撕碎了的回忆
    2020-12-04 07:48

    This is how I do to run a jasmine spec in a html using AMD/requirejs for all my sources and specs.

    This is my index.html file that loads jasmine and then my 'unit test starter' :

    unit test
    
    
    
    
    
    
    
    
    

    and then my UnitTestStarter.js is something like this:

    require.config({
        "paths": {
            ....
    });
    require(['MySpec.js'], function()
    {
        jasmine.getEnv().execute();
    })
    

提交回复
热议问题