Git Product home page Git Product logo

mowatch's People

Contributors

boneskull avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

isabella232

mowatch's Issues

mowatch fails to use local mocha

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

mowatch ignores custom extensions

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.