0

I have several Mocha tests, which I call using mocha via npm run test. The tests are separated into multiple name.test.js files. Additionally they share some functions though imports (ES6).

I need to be able to run those tests, without having Node or NPM installed on the machine. So I wanted to check out if and how pkg can handle this.

Any idea if this is possible and, if it is, how it can be done?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
pgalle
  • 216
  • 3
  • 13

1 Answers1

0

When you are working with Mocha and node.js, be aware that once you install it locally, the packages will be available in the node_modules folder with a "local" setup of mocha and all other necessary dependencies.

Once you have this you can just include node_modules inside the pkg configuration in the package.json file

Here is a StackOverflow article that mentions this, maybe it will help.