Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jokeyrhyme/npm-bin-ava-tester.js
ready-to-use ava tests for CLIs written with Node.js and NPM
https://github.com/jokeyrhyme/npm-bin-ava-tester.js
ava ava-tests cli nodejs npm
Last synced: 21 days ago
JSON representation
ready-to-use ava tests for CLIs written with Node.js and NPM
- Host: GitHub
- URL: https://github.com/jokeyrhyme/npm-bin-ava-tester.js
- Owner: jokeyrhyme
- License: mit
- Created: 2016-09-16T01:36:07.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-06-01T01:15:18.000Z (over 4 years ago)
- Last Synced: 2024-10-14T21:23:39.678Z (25 days ago)
- Topics: ava, ava-tests, cli, nodejs, npm
- Language: JavaScript
- Size: 165 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# npm-bin-ava-tester.js [![npm](https://img.shields.io/npm/v/npm-bin-ava-tester.svg?maxAge=2592000)](https://www.npmjs.com/package/npm-bin-ava-tester) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/jokeyrhyme/npm-bin-ava-tester.js?branch=master&svg=true)](https://ci.appveyor.com/project/jokeyrhyme/npm-bin-ava-tester-js) [![Travis CI Status](https://travis-ci.org/jokeyrhyme/npm-bin-ava-tester.js.svg?branch=master)](https://travis-ci.org/jokeyrhyme/npm-bin-ava-tester.js)
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](https://nodejs.org/)
- published to [NPM](https://www.npmjs.com/)
- already tested (or otherwise compatible) with [ava](https://github.com/avajs/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:
```js
const test = require('ava')
const npmBinTester = require('npm-bin-ava-tester')npmBinTester(test)
```That's it!