zinserjan / mocha-webpack

mocha test runner with integrated webpack precompiler
http://zinserjan.github.io/mocha-webpack/
MIT License
485 stars 75 forks source link

Q: `--watch` not triggering changes in src/, only works for changes in test/? #259

Open Streemo opened 6 years ago

Streemo commented 6 years ago
webpack4-app/
  dist/
  src/ (all source, no tests)
  test/ (all tests)
mocha-webpack --watch --webpack-config conf.js --recursive './test/**/*.test.js'

Right now, this is working only when test/ files are changed, but not when src/ files are changed. Is this intended behavior? Thanks.

flowstate commented 6 years ago

it's because of the path you have at the end. If instead you used

mocha-webpack --watch --webpack-config conf.js --recursive '*/**/*.test.js'

it would grab both. It will also look at dist/, but as long as you have no *.test.js files in there, it's fine.