1. @tapjs/spawn
a built-in tap extension for t.spawn()
@tapjs/spawn
Package: @tapjs/spawn
Created by: tapjs
Last modified: Tue, 26 Mar 2024 23:25:40 GMT
Version: 1.1.20
License: BlueOak-1.0.0
Downloads: 120,935
Repository: https://github.com/tapjs/tapjs

Install

npm install @tapjs/spawn
yarn add @tapjs/spawn

@tapjs/spawn

A default tap plugin providing t.spawn().

USAGE

This plugin is installed with tap by default. If you had
previously removed it, you can tap plugin add @tapjs/spawn to
bring it back.

Interface SpawnOpts

Options for t.spawn()

All of the normal Base and Extra options are also allowed.

  • cwd - string, the current working directory of the subprocess
  • env - Environment variables for the subprocess. Defaults to
    process.env
  • stdio - ChildProcess stdio option. Standard output is
    always set to 'pipe', because that's how it communicates test
    results, and file descriptor 3 is set to an IPC channel for
    sending timeout signals.
  • command (internal) - the command to run (set by first
    argument to t.spawn)
  • args (internal) - arguments to subprocess (set by second
    argument to t.spawn)
  • exitCode (internal) - Set on exit. The exit code of the
    process, or null if terminated with a signal.
  • signal (internal) - Set on exit. Terminating signal, or null
    of not terminated with a signal.

t.spawn(cmd, [args], [options], [name]): PromiseWithSpawn

Arguments:

  • cmd string - The command to run
  • args (optional) string | string[] - Arguments to pass to
    the command.
  • options (optional) SpawnOpts object

Spawns a process when the test starts, parsing its standard
output as a TAP stream.

This is how the tap CLI runs test programs.

Returns a Promise that resolves when the test is complete. The
subtest member on the Promise is a
Spawn
instance.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code