Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

ESM-compatible Tape.js test runner

License

NotificationsYou must be signed in to change notification settings

vanillaes/tape-es

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ATape.js test runner and watcher for modern JavaScript. Works with both ES modules and CommonJS.

GitHub ReleaseNPM ReleaseLatest StatusRelease Status

Discord

Features

  • runs ES module tests
  • runs tests in parallel for speed
  • uses sensible defaults
  • works withtype: module packages

Note: Since this is an ES package, it requires Node >= v14.x

tape-es

Arguments

tape-es [pattern] -i [pattern] -r [path] -t [number]

  • [pattern] - the file matcher pattern (default**/*.spec.js)
  • -i |--ignore - the ignore matcher pattern (default**/node_modules/**)
  • -r |--root - the root path to run the tests from (defaultprocess.cwd())
  • -t |--threads - Number of threads to run concurrently (default10)

Basic Usage

Use the defaults

tape-es

Advanced Usage

Specify custom parameters

tape-es"**/*.spec.js" -i"node_modules/**" -r ../absurdum/ -t 20

Note: In Linux/OSX the matcher patterns must be delimited in quotes.

tape-watch-es

Arguments

tape-es [pattern] -i [pattern] -r [path]

  • [pattern] - the file matcher pattern (default**/*.spec.js)
  • -i |--ignore - the ignore matcher pattern (default**/node_modules/**)
  • -r |--root - the root path to run the tests from (defaultprocess.cwd())

Basic Usage

Use the defaults

tape-watch-es

Advanced Usage

Specify custom parameters

tape-es"**/*.spec.js" -i"node_modules/**" -r ../absurdum/

Note: In Linux/OSX the matcher patterns must be delimited in quotes.

Writing Tests

Tests are identical to Tape.js, exceptimport is used to load modules rather than require.

importtestfrom'tape';import{arrays}from'../../index.js';test('arrays.chunk(array) - should return a chunk for each item in the array',t=>{// ...test code});

Tap Reporters

One of the greatest advantages to using Tape, is that it outputs results in the standardTAP format. That means you can pipe the results into a wide array of TAP reporters.

The parallel nature of this runner will break most reporters. As a General rule.

  1. if you want speed (ie CI/CD) don't use a reporter
  2. if you want speed and readability usetap-spec
  3. if you want to use any reporter, run tests in parallel withtape-es -t 1

[8]ページ先頭

©2009-2025 Movatter.jp