Skip to content

Instantly share code, notes, and snippets.

@kevinoid
Last active February 15, 2017 02:27
Show Gist options
  • Save kevinoid/84b3c5b3a3efe2147dfd3b8538d4ca98 to your computer and use it in GitHub Desktop.
Save kevinoid/84b3c5b3a3efe2147dfd3b8538d4ca98 to your computer and use it in GitHub Desktop.
Example of Yargs issue locating config under Mocha

To demonstrate the issue, notice the difference between the following:

$ node index.js
string

and

$ npm run test
number
[...]
#!/usr/bin/env node
console.log(typeof require('yargs')(['--arg', '123']).argv.arg);
{
"name": "yargs-issue-config-search",
"version": "1.0.0",
"description": "Example of Yargs issue locating config under Mocha",
"main": "index.js",
"scripts": {
"test": "mocha index.js"
},
"devDependencies": {
"mocha": "^3.2.0",
"yargs": "^6.6.0"
},
"yargs": {
"parse-numbers": false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment