Cannot install phantomJS in Karma
npm install karma-jasmine –save-dev npm install karma-phantomjs-launcher –save-dev Then add the following line to karma.config.js plugins : [‘karma-jasmine’, ‘karma-phantomjs-launcher’]
npm install karma-jasmine –save-dev npm install karma-phantomjs-launcher –save-dev Then add the following line to karma.config.js plugins : [‘karma-jasmine’, ‘karma-phantomjs-launcher’]
Browserify is meant to be fed a single “entry point” file, through which it recursively traverses all of your require statements, importing the code from other modules. So you should be require‘ing the _babel.js versions of modules, not _browserified.js ones. From the looks of it, you intend for your app’s “entry point” to be demos/helicopter_game/PlayState_browserified.js, … Read more
You have to install connect and serve-static: npm install –save-dev grunt-contrib-connect serve-static And then you have to import serve-static in Gruntfile.js: module.exports = function (grunt) { … var serveStatic = require(‘serve-static’); grunt.initConfig({ … connect: { … livereload: { options: { middleware: function(connect) { return [ serveStatic(‘.tmp’), connect().use(‘/bower_components’, serveStatic(‘./bower_components’)), serveStatic(config.app) ]; } } }
use the grunt-env plugin: https://npmjs.org/package/grunt-env and set your config: grunt.initConfig({ env : { options : { //Shared Options Hash }, dev : { NODE_ENV : ‘development’, DEST : ‘temp’ } }, ‘another-task’: {} }); in your gruntfile you will probably define some default-task: grunt.registerTask(‘default’, [‘env’, ‘another-task’]); so if you run ‘grunt default’ at first your … Read more
Try following Gruntfile.js. It ignores psd directory. Solution found in following question. module.exports = function(grunt) { // Project configuration. grunt.initConfig({ copy: { main: { src: [‘**/*’, ‘!**/psd/**’], expand: true, cwd: ‘dev’, dest: ‘pub’, } } }); // Load the plugin that provides the “copy” task. grunt.loadNpmTasks(‘grunt-contrib-copy’); // Default task(s). grunt.registerTask(‘default’, [‘copy’]); }; example setup. mkdir … Read more
I seem to have fixed my problem, for anyone with a similar problem: Within my karma.conf.js I added the following: plugins: [ ‘karma-chrome-launcher’, ‘karma-jasmine’ ], At first I added ‘karma-jasmine’ but was then met with “Can not load “Chrome”, it is not registered!” This was solved by adding ‘karma-chrome-launcher’ as a plug-in Not sure if … Read more
I implemented: https://github.com/erickrdch/grunt-string-replace In my source css/js files, I use the text {{ VERSION }} which gets replaced with the version number set in the package.json file. Below is the config I added to Gruntfile.js. ‘string-replace’: { version: { files: { // the files I did string replacement on }, options: { replacements: [{ pattern: … Read more
As I mentioned in a comment to your question – PhantomJS saves a lot of hassle. That aside, I believe you can handle everything from within your Gruntfile and just continue to run grunt test to start the whole thing. grunt-karma allows full customization of your karma options with some handy add-ons. From the docs: … Read more
Update This answer was originally written in 2015. The compatibility table link shows Chrome, FF, Edge, and Safari are more compatible than Babel now. Chrome 49+, FF 45+ may not benefit from Babel. Other browsers, may need transpiling. Original I am also currently developing a Chrome Extension in ES6. Your questions seems to be more … Read more
Use an ENV variable to pass the argument to files in karma.conf.js: files: [ include1, include2, …, includeN, process.env.JS_TESTS + “/*.js” ] Then run karma like so: JS_TESTS=test/category2 karma start karma.conf.js