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

Install

npm install @tapjs/worker
yarn add @tapjs/worker

@tapjs/worker

A default tap plugin providing t.worker().

USAGE

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

Interface WorkerOpts

Options for t.worker()

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

  • workerData - Any data passed to the Worker thread.
    Shows up in the worker thread as t.workerData on the root
    TAP test.
  • env - Environment variables provided to the worker thread
  • eval - if set to true, then the filename will be treated
    as inline JavaScript code rather than a filename to run.

t.worker(filename, [options], [name]): PromiseWithWorker

Arguments:

  • filename string - The file to execute in the thread, or if
    { eval: true } is in the options, a string of JavaScript code
    to run.
  • options (optional) WorkerOpts object
  • name (optional) string - name of the subtest

Starts a Node.js
Worker

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

Returns a Promise that resolves when the test is complete. The
subtest member on the Promise is a
Worker
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