Ask HN: Simplest JavaScript Testing Setup?
In 2019, what's the simplest setup for single-command local testing of a brand new Javascript library?
The goal is to minimize the NPM and Webpack (et al) yaks that need to be shaved in order to focus on the code first, while including test coverage from the outset.
2 comments
[ 6.2 ms ] story [ 27.5 ms ] threadIn a.js:
In a.test.js: In package.json: In your shell: A few things to note:* Node.js has console.assert() but it is really noisy.
* console.group() could be used to… group assertions and indent output.
* This works for ES6 modules, too, with --experimental-modules and .mjs extensions.
If you want something serious but still lightweight, there's always https://github.com/MithrilJS/mithril.js/tree/next/ospec.