mochajs / mowatch Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
node version 4.2.2
to reproduce:
npm install -g mowatch
git clone [email protected]:Oakleon/node-template-project.git
cd node-template-project
npm install
mowatch test -w src
# save file src/index.js
output
mowatch: Watching test/*.js, src/*.js
module.js:339
throw err;
^
Error: Cannot find module 'mocha'
at Function.Module._resolveFilename (module.js:337:15)
at Function.require.resolve (module.js:389:19)
at binPath ($HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/node_modules/bin-path/index.js:10:42)
at Function.findMocha ($HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/lib/index.js:24:19)
at executeMocha ($HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/lib/index.js:94:22)
at Gaze.<anonymous> ($HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/lib/index.js:85:7)
at emitTwo (events.js:87:13)
at Gaze.emit (events.js:172:7)
at Gaze.emit ($HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/node_modules/gaze/lib/gaze.js:129:32)
at $HOME/.nvm/versions/node/v4.2.2/lib/node_modules/mowatch/node_modules/gaze/lib/gaze.js:415:16
if I npm install -g mocha
then mowatch works as expected
I'm trying to use mowatch
to test a TypeScript project (with *.ts files).
The mocha command I use is mocha --recursive --compilers ts:ts-node/register src
, so that node uses ts-node
to import TypeScript files and so that Mocha discovers .ts
files.
However, mowatch hard codes the .js
extension into globberFactory
, so it doesn't find the source files and throws an error:
Error: Error: ENOENT: no such file or directory, stat 'src/**/*.spec.ts'
at fatal (/Users/janslow/dev/cfl/cfl-npm/generator-npm/node_modules/mowatch/bin/mowatch.js:34:9)
at /Users/janslow/dev/test/node_modules/mowatch/bin/mowatch.js:46:16
at /Users/janslow/dev/test/node_modules/async/lib/async.js:52:16
at /Users/janslow/dev/test/node_modules/async/lib/async.js:361:13
at /Users/janslow/dev/test/node_modules/async/lib/async.js:52:16
at done (/Users/janslow/dev/test/node_modules/async/lib/async.js:241:17)
at /Users/janslow/dev/test/node_modules/async/lib/async.js:44:16
at /Users/janslow/dev/test/node_modules/async/lib/async.js:358:17
at /Users/janslow/dev/test/node_modules/mowatch/lib/index.js:54:16
at /Users/janslow/dev/test/node_modules/async/lib/async.js:52:16
It would be useful if the --compilers
(and probably --watch-extensions
) was used to build the glob.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.