0

The Question

I'm creating unit tests for a web-app and it uses JavaScript. I've chosen to use Node.JS, Karma (as the test runner), and Mocha (as the unit testing framework). Assuming Node.JS, Karma, and Mocha are all installed into their default directories, using the following commands in Linux, what are their directories?

$ sudo apt install npm
$ sudo npm install --global mocha
$ sudo npm install --global karma

The reason I ask is, my IDE needs the locations of all three before it can run a unit test.

NOTE: I've searched StackOverflow and Googled, but all the answers I've seen only list relative paths. If you could please provide absolute paths in your answer, it would be greatly appreciated!


Bonus Points :-)

While I'm asking for the default install directories on Linux, I don't want to forget about my fellow developers running Windows and Mac OS X. If you could list the default directories for Linux, Windows, and Mac OS X it'd be really nice! :-)


Some Additional Info

To keep things as simple as possible, I'm using the simplest of unit tests to verify everything is setup properly, before writing any other unit tests. Presently, I have only the following one unit test:

var assert = require('assert');
describe('String#split', function(){
    it('should return an array', function(){
        assert(Array.isArray('a,b,c'.split(',')));
    });
})
MikeyE
  • 1,756
  • 1
  • 18
  • 37
  • 1
    Run `npm config get prefix`. The executable binaries will be under `${prefix}/bin` – Phil Sep 12 '16 at 05:26
  • Thanks so much! My bad for the duplicate question. I guess I should have typed in a better question into the search bar. :-) – MikeyE Sep 12 '16 at 05:36
  • @Phil if you'd like to put your comment in a question, I'll accept it. – MikeyE Mar 04 '17 at 07:47

0 Answers0