1

I am having trouble getting my mocha test watcher to watch files that are relying on webpack aliases for their paths. The test runs correctly, but any file that is aliased or imports from an aliased file is not watched.

I have referenced this answer to get my test script working but it doesn't work with my watch script Using webpack aliases in mocha tests

These are my tests scripts:

"test": "NODE_PATH=$NODE_PATH:../ mocha --compilers js:babel-core/register --require ./tests/test-helpers.js 'tests/**/*.@(js|jsx)'",
"test:watch": "npm run test -- --watch --watch-extensions -jsx"

I have also run the "test" script with "NODE_PATH=./" which has the same problem.

Note, the watcher runs perfectly for imports from non aliased files.

Community
  • 1
  • 1
jmancherje
  • 6,439
  • 8
  • 36
  • 56

0 Answers0