npm-bin-ava-tester

ready-to-use ava tests for CLIs written with Node.js and NPM

Usage no npm install needed!

<script type="module">
  import npmBinAvaTester from 'https://cdn.skypack.dev/npm-bin-ava-tester';
</script>

README

npm-bin-ava-tester.js npm AppVeyor Status Travis CI Status

ready-to-use ava tests for CLIs written with Node.js and NPM

What is this?

I designed this package for use with CLIs that are:

  • written in Node.js

  • published to NPM

  • already tested (or otherwise compatible) with ava

This package exports a single function that conveniently initialises some basic tests for you to ensure that:

  • you have at least a basic package.json file

  • your package.json file has valid "bin" references

  • your "bin" files all exist and are executable

  • your "bin" files all use UNIX-style LF line-endings, not CR or CRLF

  • your "bin" files all start with #! /usr/bin/env node

Usage

Example ava test file:

const test = require('ava')
const npmBinTester = require('npm-bin-ava-tester')

npmBinTester(test)

That's it!