Skip to content

Instantly share code, notes, and snippets.

@whitehorse0
Last active October 28, 2018 06:25
Show Gist options
  • Save whitehorse0/cb1520284a41160328b0c27a3744d9dc to your computer and use it in GitHub Desktop.
Save whitehorse0/cb1520284a41160328b0c27a3744d9dc to your computer and use it in GitHub Desktop.
File to registry API testing Node.js
const Mocha = require('mocha')
const mocha = new Mocha() // Instantiate a Mocha instance.
var testsDir = [
'./tests/api/users/'
]
for (var i = 0; i < testsDir.length; i++) {
mocha.addFile(testsDir[i])
}
// Run the tests.
mocha.run(function (failures) {
// exit with non-zero status if there were failures
process.exitCode = failures ? -1 : 0
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment