karma-runner / grunt-karma

Grunt plugin for Karma.
MIT License
468 stars 116 forks source link

grunt-contrib-watch doesn't detect file changes for 30 seconds after start when use grunt-karma #78

Closed apuchkov closed 10 years ago

apuchkov commented 10 years ago

When I start grunt-karma via grunt watch it takes 30 seconds before grunt will start detecting any file changes.

If I use karma's built-in watch system: grunt karma:watch, then files changes are detected right after launch without any delay.

Such delay on start of grunt-contrib-watch doesn't happen with other grunt plugins: grunt-contrib-less, grunt-contrib-concat, grunt-typescript, only happens with grunt-karma.

My OS is Windows 8.

Here's my gruntfile:

module.exports = function(grunt) {    
    grunt.loadNpmTasks('grunt-karma');    
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.initConfig({
        karma: {
            watch: {
                configFile: '../../src/Tests/Config/karma.conf.js',
                singleRun: false,
                autoWatch: true,
            },
            once: {
                configFile: '../../src/Tests/Config/karma.conf.js',
                singleRun: true,
                autoWatch: false,
            },
            teamcity: {
                configFile: '../../src/Tests/Config/karma.conf.js',
                singleRun: true,
                reporters: 'teamcity'
            }
        },
        watch: {
            unitTests: {
                files: ['../../src/**/*.js'],
                tasks: ['karma:once']
            }
        }
    });

    grunt.registerTask('default', ['karma:once']);
}
dignifiedquire commented 10 years ago

Closing for now, please reopen if this is still an issue on the latest karma/grunt-karma.