Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors if growlnotify is not in path on mac #3067

Closed
3 of 4 tasks
mcollina opened this issue Oct 13, 2017 · 12 comments
Closed
3 of 4 tasks

Errors if growlnotify is not in path on mac #3067

mcollina opened this issue Oct 13, 2017 · 12 comments

Comments

@mcollina
Copy link

Prerequisites

  • Checked that your issue isn't already filed by cross referencing issues with the common mistake label
  • Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
    node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend avoiding the use of globally installed Mocha.

Description

As titled.

Steps to Reproduce

Expected behavior: no error

Actual behavior:

An error occured. { Error: spawn growlnotify ENOENT
    at _errnoException (util.js:1019:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn growlnotify',
  path: 'growlnotify',
  spawnargs:
   [ '--image',
     '/Users/matteo/Repositories/MQTT.js/node_modules/mocha/images/error.png',
     '--name',
     'mocha',
     '-m',
     '1 of 352 tests failed',
     'Failed' ] }

Reproduces how often: 100%

Versions

4.0.1, worked fine on 3.

@tripu
Copy link
Contributor

tripu commented Oct 13, 2017

Same here: travis-ci.org/w3c/echidna/jobs/287646138

@ScottFreeCode
Copy link
Contributor

I've been running Mocha 4 on Mac without use of --growl and haven't had any issues, so I presume this only occurs when using --growl; is that correct?

The requirement for the growlnotify library is specified in the readme: https://github.com/tj/node-growl#mac-os-x-darwin

Mocha upgraded from Growl 1.9.2 to 1.10.2/1.10.3 in Mocha 4.0.0/4.0.1, which may affect this, although the readme for Growl appears to have been the same before: tj/node-growl@v1.9.2...master#diff-1e290ac8433d555bce009b162cb869d0 Perhaps the fact that Growl didn't use growlnotify in 1.9.2 was a bug? It's hard for me to tell if Growl changed in that regard -- the 1.10 upgrade involves a lot of linting and ES-modernizing churn in addition to the vulnerability fix.

Mocha doesn't appear to have changed how Growl is used, only the version: v3.5.3...v4.0.1

I'm not sure whether there's anything Mocha can change in its Growl usage that would prevent needing growlnotify -- or whether, if there is, Mocha ought to be doing so.

@mcollina
Copy link
Author

I am not running mocha with —growl.

@ScottFreeCode
Copy link
Contributor

Hmm, that's surprising -- I'm trying to think of what could be different between our Macs that would affect this... Unless -- does it happen with a new empty project too? (Thinking to differentiate "it's something different about the system/environment" from "it's something different about the project".)

@mcollina
Copy link
Author

It is only this specific project: https://github.com/mqttjs/MQTT.js

@ScottFreeCode
Copy link
Contributor

Aha -- here's where --growl is being used: https://github.com/mqttjs/MQTT.js/blob/a3ecc53cd88f8876ea3ca3107d3444c945d7883a/test/mocha.opts#L1

When I have some time to spare I'll see if I can verify using Growl directly (bypassing Mocha) that 1.10.x changed the growlnotify dependency requirement.

@mcollina
Copy link
Author

Definitely that's the problem.

@cssagogo
Copy link

Is there a work around on this? I'm running into the same issue on a newly created project as well.

@cssagogo
Copy link

Not sure if this is the same issue or a new one, but I get the following error when trying to run mocha...

Running "mocha:test" (mocha) task
>> 0 passed! (0.00s)
An error occured. { Error: spawn growlnotify ENOENT
  at _errnoException (util.js:1024:11)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
  at onErrorNT (internal/child_process.js:374:16)
  at _combinedTickCallback (internal/process/next_tick.js:138:11)
  at process._tickCallback (internal/process/next_tick.js:180:9)

  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn growlnotify',
  path: 'growlnotify',
  spawnargs: 
   [ '--image',
     '/Users/adamyoungers/projects/pikadeck/node_modules/grunt-mocha/growl/ok.png',
     '-m',
     '0 passed! (0.00s)',
     '0 passed! (0.00s)' ] }
Running "mocha:test" (mocha) task
>> 0 passed! (0.00s)
An error occured. { Error: spawn growlnotify ENOENT
  at _errnoException (util.js:1024:11)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
  at onErrorNT (internal/child_process.js:374:16)
  at _combinedTickCallback (internal/process/next_tick.js:138:11)
  at process._tickCallback (internal/process/next_tick.js:180:9)

  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn growlnotify',
  path: 'growlnotify',
  spawnargs: 
   [ '--image',
     '/Users/adamyoungers/projects/pikadeck/node_modules/grunt-mocha/growl/ok.png',
     '-m',
     '0 passed! (0.00s)',
     '0 passed! (0.00s)' ] }

Here is the project I am woking on...

https://github.com/cssagogo/pikadeck

@jlchereau
Copy link

jlchereau commented Nov 1, 2017

On Windows 10 with node 8.9.0, npm-mocha 1.0.4 and mocha 4.0.1

>> 78 passed! (9.97s)
An error occured. { Error: spawn growlnotify ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn growlnotify',
  path: 'growlnotify',
  spawnargs:
   [ '/i:D:\\WebStorm\\Kidoju\\Kidoju.Mobile\\node_modules\\grunt-mocha\\growl\\ok.png',
     '78 passed! (9.97s)',
     '/t:78 passed! (9.97s)' ] }

occurs with and without mocha.opts containing:

--reporter spec
--ui bdd

@snamoah
Copy link

snamoah commented Sep 17, 2018

I fixed mine it by exempting node_modules from the test command like so

> mocha './{,!(node_modules)/**/}*test.js'

@plroebuck
Copy link
Contributor

If you use a Mac, install TerminalNotifier to enable Growl functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants