using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
POC: using Istanbul's nyc
CLI with mocha
and watch ability (using nodemon
)
Also works great with live-server
for observing html reports
"scripts": {
"watch:test:coverage": "concurrently \"live-server ./coverage\" \"nodemon -x npm run test:coverage\""
},
"devDependencies": {
...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the prime hero here | |
function curry(func, expectedCount, ...args) { | |
function _check(arr) { | |
return arr.length >= expectedCount ? _result(arr) : _curry.bind(null, arr) | |
} | |
function _curry(prev, ...rest) { | |
return _check(prev.concat(rest)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chalkline = require('chalkline'); | |
const npmName = require('npm-name'); | |
const request = require('request-promise-native'); | |
const api = 'https://www.wordgamedictionary.com/word-lists/$-letter-words/get.json?limit=0&offset=0&order=asc'; | |
(async function check() { | |
try { | |
for (let i=2; i<=4; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root = true | |
[*] | |
end_of_line = lf | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 | |
trim_trailing_whitespace = true | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/+CSCOE+/logon.html | |
/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/.%2e/etc/passwd | |
/.%2e/.%2e/.%2e/.%2e/windows/win.ini | |
/.%2e/.%2e/.%2e/.%2e/winnt/win.ini | |
/..../..../..../..../..../..../..../..../..../..../..../..../etc/passwd | |
/..../..../..../..../..../..../..../..../..../windows/win.ini | |
/..../..../..../..../..../..../..../..../..../winnt/win.ini | |
/.../.../.../.../.../.../.../.../.../windows/win.ini | |
/.../.../.../.../.../.../.../.../.../winnt/win.ini | |
/.bak/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
*.js |