ioquatix / script-runner

This package will run various script files inside of Atom. It currently supports JavaScript, CoffeeScript, Ruby, and Python. You can add more.
http://atom.io/packages/script-runner
Other
62 stars 23 forks source link

How to run a single Mocha test #49

Closed erelsgl closed 7 years ago

erelsgl commented 8 years ago

I want to run a single Mocha test.

When I stand inside the file and click "Alt+X", script-runner executes the file with Node.JS instead of Mocha, which of course causes errors.

When I add the following shebang line at the top of the file:

 #!/usr/bin/env mocha

or just:

 #!mocha

Mocha runs on all tests in the test folder, rather than just on the current file.

How can I run Mocha on the current file only?

huba commented 8 years ago

Does the script runner view say: Running: /usr/bin/env mocha <path to test> (pgid <some number>) under the title?

I could not reproduce the issue myself.

erelsgl commented 8 years ago

OK... now I get a different error. I click Alt+X, I see this:

Running: /usr/bin/env mocha <path to test> (pgid 4474)

and the test is run twice (I see the output of the test twice, one below the other).

huba commented 8 years ago

This is getting weird. cue the X-Files theme

What happens when you open up a terminal and go to wherever the test is and execute:

/usr/bin/env mocha test-name.js

erelsgl commented 8 years ago

From the terminal, the test runs only once.

ioquatix commented 7 years ago

@erelsgl we are looking to move to pty.js and this may fix the issue.. hold tight :)

ioquatix commented 7 years ago

@erelsgl Can you test on 2.0.0 which was just released and let us know if this is still an issue.

ioquatix commented 7 years ago

Additionally, if you can provide the source file or files, or git repo we can test on our end.