I'm trying to create a configuration file to run karma tests including Jasmine and requirejs, so I run karma init xyz.conf.js, and the script asks me:
What testing framework to use?I have only available jasmine, as expectedDo you want to use require.js?When this question appears, it gets automatically answerednoand moves on to the next question
I suppose it must have something to do with a missing dependency. I've installed, in this order:
npm install karma --save-dev (0.13.16)
npm install jasmine --save-dev (2.4.1)
npm install karma-jasmine --save-dev (0.3.6)
npm install karma-chrome-launcher --save-dev (0.2.2)
npm install requirejs --save-dev (2.1.22)
npm install karma-requirejs --save-dev (0.2.2)
npm -g install karma-cli --save-dev (0.1.2)
NOTE: I've included the installed version number
Do I have something missing or misconfigured? What do I have to do so that karma init allows me to specify that I want to use Require.js? Can I solve it by modifying the .conf.js by hand?
I'm not sure why the config process skipped the requirejs option, but you can manually add the
requirejsframework to your karma config file. A config file I set up with requirejs has the following framework value:frameworks: ['jasmine', 'requirejs']However, there is probably some more configuration you'll have to do in order to get it to run properly. The docs for Karma have a section for configuring the test environment to run with requirejs: http://karma-runner.github.io/0.13/plus/requirejs.html