{"action":"created","issue":{"url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/8","labels_url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/8/comments","events_url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/8/events","html_url":"https://github.com/onury/grunt-jasmine-nodejs/issues/8","id":60588413,"number":8,"title":"No specs found with grunt watch","user":{"login":"LukeRiceApperson","id":5471500,"avatar_url":"https://avatars.githubusercontent.com/u/5471500?v=3","gravatar_id":"","url":"https://api.github.com/users/LukeRiceApperson","html_url":"https://github.com/LukeRiceApperson","followers_url":"https://api.github.com/users/LukeRiceApperson/followers","following_url":"https://api.github.com/users/LukeRiceApperson/following{/other_user}","gists_url":"https://api.github.com/users/LukeRiceApperson/gists{/gist_id}","starred_url":"https://api.github.com/users/LukeRiceApperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukeRiceApperson/subscriptions","organizations_url":"https://api.github.com/users/LukeRiceApperson/orgs","repos_url":"https://api.github.com/users/LukeRiceApperson/repos","events_url":"https://api.github.com/users/LukeRiceApperson/events{/privacy}","received_events_url":"https://api.github.com/users/LukeRiceApperson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-10T23:45:53Z","updated_at":"2015-03-11T03:31:44Z","closed_at":null,"body":"First off, thanks for making this, I've been using jasmine-node and grunt-jasmine-node and having 2.x out of the box is great and so far I really like it. \r\n\r\nI'm having an issue where when using my grunt watch task, specs are found the first time but not after changes. I searched through some of the dependencies in node_modules and found places where instance variables are used to check the number of specs to be run, potentially these are not reset after each iteration of running the tests. Any ideas? Thanks.\r\n\r\nHere is my gruntfile:\r\n\r\n```javascript\r\n'use strict';\r\n\r\nmodule.exports = function(grunt) {\r\n\r\n  // Project configuration.\r\n  grunt.initConfig({\r\n    jshint: {\r\n      all: [\r\n        'Gruntfile.js',\r\n        'server.js',\r\n        'tasks/**/*.js',\r\n        'test/*.js',\r\n        'backend/**/*.js'\r\n      ],\r\n      options: {\r\n        jshintrc: '.jshintrc',\r\n        jshintignore:'.jshintignore'\r\n      },\r\n    },\r\n\r\n    jasmine_nodejs: {\r\n      options: {\r\n        specNameSuffix: \"spec.js\" // also accepts an array\r\n      },\r\n      backend: {\r\n        specs:['backend/**']\r\n      }\r\n    },\r\n\r\n    watch: {\r\n      express: {\r\n        options: {\r\n          livereload: true,\r\n          spawn: false\r\n        },\r\n        files: [\r\n          'Gruntfile.js',\r\n          'backend/**/*.js',\r\n          'server.js'\r\n        ],\r\n        tasks: ['jshint', 'jasmine_nodejs:backend', 'express:defaults']\r\n      }\r\n    },\r\n\r\n    express: {\r\n      options: {\r\n        script: './backend/server.js',\r\n        port: 5000\r\n      },\r\n      defaults: {},\r\n      stoppable: {}\r\n    }\r\n  });\r\n\r\n  // Actually load this plugin's task(s).\r\n  grunt.loadTasks('tasks');\r\n\r\n  // These plugins provide necessary tasks.\r\n  grunt.loadNpmTasks('grunt-contrib-jshint');\r\n  grunt.loadNpmTasks('grunt-contrib-watch');\r\n  grunt.loadNpmTasks('grunt-jasmine-nodejs');\r\n\r\n  // By default, lint and run all tests. Backend only so far.\r\n  grunt.registerTask('default', ['jshint', 'jasmine_nodejs:backend']);\r\n\r\n};\r\n``` \r\n\r\nand here is my console output after changes to a spec file:\r\n```\r\nC:dsafdsafdsafdsa [Scaffolding-JasmineNode +1 ~5 -1 !]> grunt watch\r\nRunning \"watch\" task\r\nWaiting...\r\n>> File \"backend\\server.js\" changed.\r\n\r\nRunning \"jshint:all\" (jshint) task\r\n>> 5 files lint free.\r\n\r\nRunning \"jasmine_nodejs:backend\" (jasmine_nodejs) task\r\nExecuting specs...\r\n\r\n.\r\n\r\nTest Suites:\r\n\r\n1) server\r\n\r\n  √ should be a function\r\n\r\n\r\n1 suite, 1 spec, 1 assert, 0 failures\r\nFinished in 0.005 seconds\r\n\r\n>> Successful!\r\n\r\nRunning \"express:defaults\" (express) task\r\nStarting background Express server\r\nserver bound to port  5000\r\n\r\nRunning \"watch\" task\r\nCompleted in 0.245s at Tue Mar 10 2015 19:40:20 GMT-0400 (Eastern Daylight Time) - Waiting...\r\n>> File \"backend\\server.spec.js\" changed.\r\n\r\nRunning \"jshint:all\" (jshint) task\r\n>> 5 files lint free.\r\n\r\nRunning \"jasmine_nodejs:backend\" (jasmine_nodejs) task\r\nExecuting specs...\r\n\r\n\r\n\r\nTest Suites:\r\nNo specs found.\r\nFinished in 0.001 seconds\r\n\r\n>> Successful!\r\n\r\nRunning \"express:defaults\" (express) task\r\nStopping Express server\r\nStarting background Express server\r\nserver bound to port  5000\r\n\r\nRunning \"watch\" task\r\nCompleted in 0.232s at Tue Mar 10 2015 19:40:31 GMT-0400 (Eastern Daylight Time) - Waiting...\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/comments/78198633","html_url":"https://github.com/onury/grunt-jasmine-nodejs/issues/8#issuecomment-78198633","issue_url":"https://api.github.com/repos/onury/grunt-jasmine-nodejs/issues/8","id":78198633,"user":{"login":"onury","id":3665990,"avatar_url":"https://avatars.githubusercontent.com/u/3665990?v=3","gravatar_id":"","url":"https://api.github.com/users/onury","html_url":"https://github.com/onury","followers_url":"https://api.github.com/users/onury/followers","following_url":"https://api.github.com/users/onury/following{/other_user}","gists_url":"https://api.github.com/users/onury/gists{/gist_id}","starred_url":"https://api.github.com/users/onury/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onury/subscriptions","organizations_url":"https://api.github.com/users/onury/orgs","repos_url":"https://api.github.com/users/onury/repos","events_url":"https://api.github.com/users/onury/events{/privacy}","received_events_url":"https://api.github.com/users/onury/received_events","type":"User","site_admin":false},"created_at":"2015-03-11T03:31:44Z","updated_at":"2015-03-11T03:31:44Z","body":"Ok. I could reproduce this issue. The problem is the `spawn:false` option in `watch` task configuration. When I use this option I get the same problem as you do. First time, it runs but second and forth it won't.\r\n\r\nOmitting the `spawn` option or setting it to `true` (as the default value) will let the task run normally.\r\n\r\nThere are lots of [issues related to `spawn`](https://github.com/gruntjs/grunt-contrib-watch/issues?q=is%3Aissue+is%3Aopen+spawn) in the grunt-contrib-watch repo. \r\n\r\nLet me know if it works for you when `spawn` option is omitted. "}}