Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No color output when using grunt-contrib-watch, color is true #159

Open
petvas opened this issue Aug 12, 2015 · 5 comments
Open

No color output when using grunt-contrib-watch, color is true #159

petvas opened this issue Aug 12, 2015 · 5 comments

Comments

@petvas
Copy link

petvas commented Aug 12, 2015

Gruntfile.js

module.exports = function (grunt) {
    'use strict';
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        karma: {
            options: {
                configFile: 'karma.conf.js'
            },
            unit: {
                background: true
            },
            continuous: {
                background: false,
                singleRun: true,
            }
        },
        jshint: {
            options: {
                reporter: require('jshint-stylish')
            },
            target: ['src/**/*.js', 'tests/**/*.js']
        },
        watch: {
            options: {
                spawn: false // add spawn option in watch task
            },
            dev: {
                files: ['src/**/*.js', 'tests/**/*.js'],
                tasks: ['jshint' , 'karma:unit:run'],
                options: {
                    spawn: false    
                }
            }
        }
    });

    require('load-grunt-tasks')(grunt);

    //defualt tasks
    grunt.registerTask('default', [ 'karma:unit:start', 'watch']);
};

karma.conf.js

module.exports = function (config) {
    config.set({
        // The root path location that will be used to resolve all relative paths defined in files and exclude. If the basePath configuration is a relative path then it will be resolved to the __dirname of the configuration file.
        basePath: '',

        // List of test frameworks you want to use. Typically, you will set this to ['jasmine'], ['mocha'] or ['qunit']...
        frameworks: ['jasmine'],

        // List of files/patterns to load in the browser.
        // included: to browser
        files: [
            {pattern: "src/**/*.js", included: true},
            {pattern: "tests/**/*.js", included: true}
        ],

        // List of files/patterns to exclude from loaded files.
        exclude: [],

        // A list of reporters to use.
        reporters: ['progress'],

        // The port where the web server will be listening.
        port: 9876,

        //  Enable or disable colors in the output (reporters and logs).
        colors: true,

        // Level of logging.
        logLevel: config.LOG_INFO,

        // Enable or disable watching files and executing the tests whenever one of these files changes.
        autoWatch: true,

        // A list of browsers to launch and capture. When Karma starts up, it will also start up each browser which is placed within this setting. Once Karma is shut down, it will shut down these browsers as well. You can capture any browser manually by opening the browser and visiting the URL where the Karma web server is listening (by default it is http://localhost:9876/).
        //Firefox: npm install karma-firefox-launcher --save-dev
        //Chrom: npm install karma-chrome-launcher --save-dev
        //IE: npm install karma-ie-launcher --save-dev
        browsers: ['Firefox', 'Chrome', 'IE'],

        // Timeout for capturing a browser (in ms).
        captureTimeout: 60000,

        // Continuous Integration mode.
        singleRun: false
    });
};
@greglockwood
Copy link

+1

@kand
Copy link

kand commented Feb 3, 2016

👍

3 similar comments
@ChiggerChug
Copy link

+1

@ghost
Copy link

ghost commented Mar 1, 2016

+1

@sqrter
Copy link

sqrter commented Apr 11, 2016

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants