Skip to content

rstacruz/tape-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tape-standard

Integrates standard into your tape tests

tape-standard allows you to enforce a "one true" JavaScript coding style in your project via tape tests.

Status

Features

This offers a finer alternative to adding standard into package.json's scripts.test block.

  • Runs in the same node process as tape, removing maybe 500ms of startup time.
  • Painlessly integrate standard into your travisci.org tests.

(Your speed gains may be a bit different from my Pentium II, of course.)

Usage

Install it:

npm install --save-dev tape-standard standard

Then add this test file to your tape suite:

test('standard', require('tape-standard')())

To configure what files to consume:

test('standard', require('tape-standard')({
  files: [ 'index.js', 'test/*.js' ]
}))

Globals

To specify global variables, pass { global: [...] } into .files(). This is especially useful for test files. (Be sure you're using standard 5.0.0 or above.)

test('standard', require('tape-standard')({
  global: ['$', 'jQuery']
}))

Semicolons

To use semistandard instead, use:

npm install --save-dev semistandard
test('standard', require('tape-standard')({
  using: require('semistandard')
}))

tape-eslint

For more flexible configuration, consider tape-eslint too, which can be configured to use Standard's configuration.

Thanks

tape-standard © 2016+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

About

Integrate standard linting to your tape tests

Resources

Stars

Watchers

Forks

Packages

No packages published