3 ms·
For sufficiently small libraries, I've done a number of READMEs with usage examples that include test assertions. The examples then serve as the test suite. Fo
by kemitchell 6y ago
For sufficiently small libraries, I've done a number of READMEs with usage examples that include test assertions. The examples then serve as the test suite. For example:
https://www.npmjs.com/package/spdx-expression-parse https://www.npmjs.com/package/spdx-expression-parse
I've released free scripts for Node.js that do the job of parsing the Markdown, extracting fenced code blocks, and filtering by infostring. That leaves just lines of code, which you can pipe straight to the Node interpreter:
https://www.npmjs.com/package/defence-cli https://www.npmjs.com/package/defence-cli