Socket
Socket
Sign inDemoInstall

@tapjs/core

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/core - npm Package Compare versions

Comparing version 0.0.0-12 to 0.0.0-13

87

dist/cjs/base.d.ts

@@ -98,2 +98,4 @@ /**

* @internal
*
* @group Internal Machinery
*/

@@ -129,2 +131,4 @@ tapChildBuffer?: string;

* @internal
*
* @group Internal Machinery
*/

@@ -141,2 +145,4 @@ indent?: string;

* @internal
*
* @group Internal Machinery
*/

@@ -181,2 +187,4 @@ parser?: Parser;

* TapWrap AsyncResource that limits the async-hook-domain
*
* @group Internal Machinery
*/

@@ -186,2 +194,4 @@ hook: TapWrap;

* the async-hook-domain that catches throws and Promise rejections
*
* @group Internal Machinery
*/

@@ -191,2 +201,4 @@ hookDomain: Domain;

* The timer that fires when the test times out
*
* @group Internal Machinery
*/

@@ -201,2 +213,4 @@ timer?: NodeJS.Timeout;

* The tap parser attached to this TAP stream
*
* @group Internal Machinery
*/

@@ -211,2 +225,4 @@ parser: Parser;

* The count of all assertions that this stream emitted
*
* @group Test Reflection
*/

@@ -217,2 +233,4 @@ counts: Counts;

* set in the options, then passing test points will also be tracked.
*
* @group Test Reflection
*/

@@ -222,2 +240,4 @@ lists: Lists;

* the name of this test
*
* @group Test Reflection
*/

@@ -227,2 +247,4 @@ name: string;

* Set on completion. The results of the test run.
*
* @group Test Reflection
*/

@@ -232,2 +254,4 @@ results?: FinalResults;

* Parent test of this TAP stream
*
* @group Internal Machinery
*/

@@ -255,2 +279,4 @@ parent?: Base | TestBase;

* Unrecoverable TAP protocol errors in the stream
*
* @group Test Reflection
*/

@@ -271,2 +297,6 @@ errors: TapError[];

* the TAP stream data for buffered tests
*
* @internal
*
* @group Internal Machinery
*/

@@ -278,2 +308,4 @@ output: string;

* @internal
*
* @group Internal Machinery
*/

@@ -283,2 +315,4 @@ buffered: boolean;

* True if this test emitted a bailout
*
* @group Test Reflection
*/

@@ -288,2 +322,4 @@ bailedOut: string | boolean;

* high resolution bigint time when this test started
*
* @group Internal Machinery
*/

@@ -293,2 +329,4 @@ start: bigint;

* Amount of time in milliseconds that this test took to complete.
*
* @group Test Reflection
*/

@@ -298,2 +336,4 @@ time: MILLISECONDS;

* High resolution time in ns that this test took to complete.
*
* @group Test Reflection
*/

@@ -307,2 +347,4 @@ hrtime: bigint;

* A `Deferred` promise wrapper that is resolved when this test completes.
*
* @group Internal Machinery
*/

@@ -319,2 +361,4 @@ deferred?: Deferred<FinalResults>;

* indefinitely.
*
* @group Test Lifecycle Management
*/

@@ -328,2 +372,4 @@ setTimeout(n: MILLISECONDS): void;

* @internal
*
* @group Internal Machinery
*/

@@ -340,6 +386,10 @@ timeout(options?: {

* @internal
*
* @group Internal Machinery
*/
runMain(cb: () => void): void;
/**
* getter for the high resolution time when this test began
* Returns true if this test has begun
*
* @group Test Reflection
*/

@@ -349,2 +399,4 @@ get started(): boolean;

* True if the test has printed *some* output of any kind
*
* @group Test Reflection
*/

@@ -355,2 +407,6 @@ get printedOutput(): boolean;

* implement this in their specific ways.
*
* @internal
*
* @group Internal Machinery
*/

@@ -365,2 +421,9 @@ main(cb: () => void): void;

* called.
*
* Note: you *probably* never need to call this. Instead, use the various
* assertion methods and other parts of the API.
*
* @internal
*
* @group Internal Machinery
*/

@@ -379,2 +442,6 @@ write(c: string): boolean;

* {@link @tapjs/core!tap.TAP} classes
*
* @internal
*
* @group Internal Machinery
*/

@@ -388,2 +455,6 @@ oncomplete(results: FinalResults): void;

* the TAP stream.
*
* @internal
*
* @group Internal Machinery
*/

@@ -394,2 +465,6 @@ onbeforeend(): Promise<void> | void;

* is completely done, and terminating its parser.
*
* @internal
*
* @group Internal Machinery
*/

@@ -402,2 +477,4 @@ onEOF(): Promise<void> | void;

* @internal
*
* @group Internal Machinery
*/

@@ -409,2 +486,6 @@ ondone(): void;

* {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.
*
* @internal
*
* @group Internal Machinery
*/

@@ -425,2 +506,4 @@ emit<Event extends keyof Events>(ev: Event, ...data: Events[Event]): boolean;

* @internal
*
* @group Internal Machinery
*/

@@ -430,2 +513,4 @@ threw(er: any, extra?: Extra, proxy?: boolean, ended?: boolean): Extra | void | undefined;

* returns true if the test has not as yet encountered any failures
*
* @group Test Reflection
*/

@@ -432,0 +517,0 @@ passing(): boolean;

@@ -61,2 +61,4 @@ "use strict";

* TapWrap AsyncResource that limits the async-hook-domain
*
* @group Internal Machinery
*/

@@ -68,2 +70,4 @@ hook;

* the async-hook-domain that catches throws and Promise rejections
*
* @group Internal Machinery
*/

@@ -73,2 +77,4 @@ hookDomain;

* The timer that fires when the test times out
*
* @group Internal Machinery
*/

@@ -83,2 +89,4 @@ timer;

* The tap parser attached to this TAP stream
*
* @group Internal Machinery
*/

@@ -93,2 +101,4 @@ parser;

* The count of all assertions that this stream emitted
*
* @group Test Reflection
*/

@@ -99,2 +109,4 @@ counts;

* set in the options, then passing test points will also be tracked.
*
* @group Test Reflection
*/

@@ -104,2 +116,4 @@ lists;

* the name of this test
*
* @group Test Reflection
*/

@@ -109,2 +123,4 @@ name;

* Set on completion. The results of the test run.
*
* @group Test Reflection
*/

@@ -114,2 +130,4 @@ results;

* Parent test of this TAP stream
*
* @group Internal Machinery
*/

@@ -137,2 +155,4 @@ parent;

* Unrecoverable TAP protocol errors in the stream
*
* @group Test Reflection
*/

@@ -153,2 +173,6 @@ errors;

* the TAP stream data for buffered tests
*
* @internal
*
* @group Internal Machinery
*/

@@ -160,2 +184,4 @@ output;

* @internal
*
* @group Internal Machinery
*/

@@ -165,2 +191,4 @@ buffered;

* True if this test emitted a bailout
*
* @group Test Reflection
*/

@@ -170,2 +198,4 @@ bailedOut;

* high resolution bigint time when this test started
*
* @group Internal Machinery
*/

@@ -176,2 +206,4 @@ start;

* Amount of time in milliseconds that this test took to complete.
*
* @group Test Reflection
*/

@@ -181,2 +213,4 @@ time;

* High resolution time in ns that this test took to complete.
*
* @group Test Reflection
*/

@@ -190,2 +224,4 @@ hrtime;

* A `Deferred` promise wrapper that is resolved when this test completes.
*
* @group Internal Machinery
*/

@@ -301,2 +337,4 @@ deferred;

* indefinitely.
*
* @group Test Lifecycle Management
*/

@@ -324,2 +362,4 @@ setTimeout(n) {

* @internal
*
* @group Internal Machinery
*/

@@ -355,2 +395,4 @@ timeout(options = {

* @internal
*
* @group Internal Machinery
*/

@@ -364,3 +406,5 @@ runMain(cb) {

/**
* getter for the high resolution time when this test began
* Returns true if this test has begun
*
* @group Test Reflection
*/

@@ -372,2 +416,4 @@ get started() {

* True if the test has printed *some* output of any kind
*
* @group Test Reflection
*/

@@ -380,2 +426,6 @@ get printedOutput() {

* implement this in their specific ways.
*
* @internal
*
* @group Internal Machinery
*/

@@ -392,2 +442,9 @@ main(cb) {

* called.
*
* Note: you *probably* never need to call this. Instead, use the various
* assertion methods and other parts of the API.
*
* @internal
*
* @group Internal Machinery
*/

@@ -415,2 +472,4 @@ write(c) {

* @internal
*
* @group Internal Machinery
*/

@@ -426,2 +485,6 @@ #online(line) {

* {@link @tapjs/core!tap.TAP} classes
*
* @internal
*
* @group Internal Machinery
*/

@@ -461,2 +524,6 @@ oncomplete(results) {

* the TAP stream.
*
* @internal
*
* @group Internal Machinery
*/

@@ -467,2 +534,6 @@ onbeforeend() { }

* is completely done, and terminating its parser.
*
* @internal
*
* @group Internal Machinery
*/

@@ -475,2 +546,4 @@ onEOF() { }

* @internal
*
* @group Internal Machinery
*/

@@ -482,2 +555,6 @@ ondone() { }

* {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.
*
* @internal
*
* @group Internal Machinery
*/

@@ -508,2 +585,4 @@ emit(ev, ...data) {

* @internal
*
* @group Internal Machinery
*/

@@ -571,2 +650,4 @@ threw(er, extra, proxy = false, ended = false) {

* returns true if the test has not as yet encountered any failures
*
* @group Test Reflection
*/

@@ -573,0 +654,0 @@ passing() {

@@ -55,2 +55,5 @@ "use strict";

}
if (res.errorOrigin && typeof res.errorOrigin === 'object') {
res.errorOrigin = (0, exports.cleanYamlObject)(res.errorOrigin);
}
if (res.at &&

@@ -57,0 +60,0 @@ res.at instanceof stack.CallSiteLike &&

@@ -10,2 +10,3 @@ /**

export * from './counts.js';
export * from './extra-from-error.js';
export * from './lists.js';

@@ -47,2 +48,7 @@ export * from './main-script.js';

source?: string;
errorOrigin?: {
at?: CallSiteLike | CallSiteLikeJSON | null;
stack?: string;
source?: string;
};
found?: any;

@@ -49,0 +55,0 @@ wanted?: any;

@@ -26,2 +26,3 @@ "use strict";

__exportStar(require("./counts.js"), exports);
__exportStar(require("./extra-from-error.js"), exports);
__exportStar(require("./lists.js"), exports);

@@ -28,0 +29,0 @@ __exportStar(require("./main-script.js"), exports);

@@ -17,2 +17,5 @@ import { PromiseWithSubtest, TestBase, TestBaseOpts } from './test-base.js';

constructor(opts: TestBaseOpts);
/**
* Spawn a subtest that is also a {@link @tapjs/core!minimal.Minimal}
*/
test(name: string, extra: TestBaseOpts, cb: (t: Minimal) => any): PromiseWithSubtest<Minimal>;

@@ -19,0 +22,0 @@ test(name: string, cb: (t: Minimal) => any): PromiseWithSubtest<Minimal>;

99

dist/cjs/test-base.d.ts

@@ -30,2 +30,4 @@ /// <reference types="node" resolution-mode="require"/>

* @internal
*
* @group Internal Machinery
*/

@@ -146,4 +148,11 @@ cb?: (...args: any[]) => any;

* or during plugin setup time, this will be undefined, so watch out.
*
* @group Test Reflection
*/
t: Test;
/**
* A promise that resolves when the test is done.
*
* @group Internal Machinery
*/
donePromise?: Promise<any> & {

@@ -154,2 +163,4 @@ tapAbortPromise?: () => void;

* The number of subtests to run in parallel, if allowed
*
* @group Test Lifecycle Management
*/

@@ -160,2 +171,4 @@ jobs: number;

* and have not yet completed.
*
* @group Internal Machinery
*/

@@ -165,2 +178,4 @@ subtests: Base[];

* The pool of parallel tests currently in process
*
* @group Internal Machinery
*/

@@ -171,2 +186,4 @@ pool: Set<Base>;

* {@link @tapjs/core!test-base.QueueEntry} item.
*
* @group Internal Machinery
*/

@@ -176,2 +193,6 @@ queue: QueueEntry[];

* Function that will get this test as an argument when it is processed
*
* @internal
*
* @group Internal Machinery
*/

@@ -181,2 +202,4 @@ cb?: (...args: any[]) => any;

* The count of all assertions this test has seen
*
* @group Test Reflection
*/

@@ -195,2 +218,4 @@ count: number;

* Subtests that are currently in process.
*
* @group Internal Machinery
*/

@@ -201,2 +226,4 @@ activeSubtests: Set<Base>;

* excluding child test summary points
*
* @group Test Reflection
*/

@@ -206,2 +233,4 @@ assertTotals: Counts;

* true if the test has printed at least one TestPoint
*
* @group Test Reflection
*/

@@ -211,2 +240,4 @@ get printedResult(): boolean;

* true if the test is currently waiting for something to finish
*
* @group Test Reflection
*/

@@ -219,3 +250,3 @@ get occupied(): boolean;

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -232,4 +263,2 @@ bailout(message?: string): void;

* to standard output.
*
* @group TAP generation methods
*/

@@ -241,3 +270,5 @@ comment(...args: any[]): void;

*
* @group TAP generation methods
* @internal
*
* @group Internal Machinery
*/

@@ -250,4 +281,2 @@ timeout(options?: Extra & {

* Only `strict` is supported by the parser.
*
* @group TAP generation methods
*/

@@ -261,3 +290,3 @@ pragma(set: {

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -269,3 +298,3 @@ plan(n: number, comment?: string): void;

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -276,14 +305,12 @@ pass(...[msg, extra]: MessageExtra): boolean;

*
* @group TAP generation methods
* @group Assertion Methods
*/
fail(...[msg, extra]: MessageExtra): boolean;
/**
* The current assertion being processed. May only be set if
* not already set.
* The current assertion being processed. Set at the start of all
* assertions, and used for calculating stack traces.
*
* @group Internal Machinery
*/
get currentAssert(): null | Function | ((...a: any[]) => any);
/**
* The current assertion being processed. May only be set if
* not already set.
*/
set currentAssert(fn: null | Function | ((...a: any[]) => any));

@@ -297,3 +324,3 @@ /**

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -305,6 +332,9 @@ end(implicit?: typeof IMPLICIT): this;

*
* This is primarily internal, but is used in some plugins, whenever
* a promise must be awaited before proceeding. In normal test usage,
* it's usually best to simply use an async test function and `await`
* promises as normal.
* This is internal, used in some plugins when a promise must be awaited
* before proceeding. In normal test usage, it's usually best to simply use
* an async test function and `await` promises as normal.
*
* @internal
*
* @group Internal Machinery
*/

@@ -326,2 +356,4 @@ waitOn(promise: Promise<any | void>, cb?: (w: Waiter) => any, expectReject?: boolean): Promise<void>;

* @internal
*
* @group Internal Machinery
*/

@@ -332,2 +364,4 @@ main(cb: () => void): void;

* If used, then no other subtests or assertions are allowed.
*
* @group Subtest Methods
*/

@@ -343,2 +377,4 @@ stdinOnly<T extends BaseOpts>(extra?: T & {

*
* @group Subtest Methods
*
* @internal

@@ -356,2 +392,4 @@ */

* @internal
*
* @group Internal Machinery
*/

@@ -361,2 +399,15 @@ threw(er: any, extra?: Extra, proxy?: boolean): Extra | void | undefined;

* Method called when the parser encounters a bail out
*
* To listen to bailout events, listen to the
* {@link @tapjs/core!base.TapBaseEvents#bailout} event:
*
* ```ts
* t.on('bailout', message => {
* // test bailed out!
* })
* ```
*
* @internal
*
* @group Internal Machinery
*/

@@ -372,2 +423,6 @@ onbail(message?: string): void;

* indefinitely.
*
* @internal
*
* @group Internal Machinery
*/

@@ -378,2 +433,6 @@ endAll(sub?: boolean): void;

* should be skipped. Extended by the `@tapjs/filter` plugin.
*
* @internal
*
* @group Internal Machinery
*/

@@ -380,0 +439,0 @@ shouldSkipChild<O extends BaseOpts>(extra: O | TestBaseOpts | BaseOpts): boolean;

@@ -71,7 +71,16 @@ "use strict";

* or during plugin setup time, this will be undefined, so watch out.
*
* @group Test Reflection
*/
t;
/**
* A promise that resolves when the test is done.
*
* @group Internal Machinery
*/
donePromise;
/**
* The number of subtests to run in parallel, if allowed
*
* @group Test Lifecycle Management
*/

@@ -82,2 +91,4 @@ jobs;

* and have not yet completed.
*
* @group Internal Machinery
*/

@@ -87,2 +98,4 @@ subtests = [];

* The pool of parallel tests currently in process
*
* @group Internal Machinery
*/

@@ -93,2 +106,4 @@ pool = new Set();

* {@link @tapjs/core!test-base.QueueEntry} item.
*
* @group Internal Machinery
*/

@@ -98,2 +113,6 @@ queue = [VERSION];

* Function that will get this test as an argument when it is processed
*
* @internal
*
* @group Internal Machinery
*/

@@ -103,2 +122,4 @@ cb;

* The count of all assertions this test has seen
*
* @group Test Reflection
*/

@@ -133,2 +154,4 @@ count = 0;

* Subtests that are currently in process.
*
* @group Internal Machinery
*/

@@ -139,2 +162,4 @@ activeSubtests = new Set();

* excluding child test summary points
*
* @group Test Reflection
*/

@@ -150,2 +175,4 @@ assertTotals = new index_js_1.Counts({

* true if the test has printed at least one TestPoint
*
* @group Test Reflection
*/

@@ -157,2 +184,4 @@ get printedResult() {

* true if the test is currently waiting for something to finish
*
* @group Test Reflection
*/

@@ -179,3 +208,2 @@ get occupied() {

}
// TAP output generating methods
/**

@@ -185,3 +213,3 @@ * immediately exit this and all parent tests with a TAP

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -210,4 +238,2 @@ bailout(message) {

* to standard output.
*
* @group TAP generation methods
*/

@@ -243,3 +269,5 @@ comment(...args) {

*
* @group TAP generation methods
* @internal
*
* @group Internal Machinery
*/

@@ -259,4 +287,2 @@ timeout(options = { expired: this.name }) {

* Only `strict` is supported by the parser.
*
* @group TAP generation methods
*/

@@ -300,3 +326,3 @@ pragma(set) {

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -313,3 +339,3 @@ pass(...[msg, extra]) {

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -324,4 +350,6 @@ fail(...[msg, extra]) {

/**
* The current assertion being processed. May only be set if
* not already set.
* The current assertion being processed. Set at the start of all
* assertions, and used for calculating stack traces.
*
* @group Internal Machinery
*/

@@ -331,6 +359,2 @@ get currentAssert() {

}
/**
* The current assertion being processed. May only be set if
* not already set.
*/
set currentAssert(fn) {

@@ -344,5 +368,5 @@ if (!this.#currentAssert && typeof fn === 'function') {

*
* @group TAP generation methods
* @internal
*
* @internal
* @group Internal Machinery
*/

@@ -461,3 +485,3 @@ #printResult(ok, message, extra, front = false) {

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -472,2 +496,4 @@ end(implicit) {

* @internal
*
* @group Internal Machinery
*/

@@ -488,6 +514,9 @@ #writeSubComment(p) {

*
* This is primarily internal, but is used in some plugins, whenever
* a promise must be awaited before proceeding. In normal test usage,
* it's usually best to simply use an async test function and `await`
* promises as normal.
* This is internal, used in some plugins when a promise must be awaited
* before proceeding. In normal test usage, it's usually best to simply use
* an async test function and `await` promises as normal.
*
* @internal
*
* @group Internal Machinery
*/

@@ -802,2 +831,4 @@ waitOn(promise, cb, expectReject = false) {

* @internal
*
* @group Internal Machinery
*/

@@ -892,2 +923,4 @@ main(cb) {

* If used, then no other subtests or assertions are allowed.
*
* @group Subtest Methods
*/

@@ -944,2 +977,4 @@ stdinOnly(extra) {

*
* @group Subtest Methods
*
* @internal

@@ -1011,2 +1046,4 @@ */

* @internal
*
* @group Internal Machinery
*/

@@ -1091,2 +1128,15 @@ threw(er, extra, proxy = false) {

* Method called when the parser encounters a bail out
*
* To listen to bailout events, listen to the
* {@link @tapjs/core!base.TapBaseEvents#bailout} event:
*
* ```ts
* t.on('bailout', message => {
* // test bailed out!
* })
* ```
*
* @internal
*
* @group Internal Machinery
*/

@@ -1108,2 +1158,6 @@ onbail(message) {

* indefinitely.
*
* @internal
*
* @group Internal Machinery
*/

@@ -1152,2 +1206,6 @@ endAll(sub = false) {

* should be skipped. Extended by the `@tapjs/filter` plugin.
*
* @internal
*
* @group Internal Machinery
*/

@@ -1154,0 +1212,0 @@ shouldSkipChild(extra) {

@@ -98,2 +98,4 @@ /**

* @internal
*
* @group Internal Machinery
*/

@@ -129,2 +131,4 @@ tapChildBuffer?: string;

* @internal
*
* @group Internal Machinery
*/

@@ -141,2 +145,4 @@ indent?: string;

* @internal
*
* @group Internal Machinery
*/

@@ -181,2 +187,4 @@ parser?: Parser;

* TapWrap AsyncResource that limits the async-hook-domain
*
* @group Internal Machinery
*/

@@ -186,2 +194,4 @@ hook: TapWrap;

* the async-hook-domain that catches throws and Promise rejections
*
* @group Internal Machinery
*/

@@ -191,2 +201,4 @@ hookDomain: Domain;

* The timer that fires when the test times out
*
* @group Internal Machinery
*/

@@ -201,2 +213,4 @@ timer?: NodeJS.Timeout;

* The tap parser attached to this TAP stream
*
* @group Internal Machinery
*/

@@ -211,2 +225,4 @@ parser: Parser;

* The count of all assertions that this stream emitted
*
* @group Test Reflection
*/

@@ -217,2 +233,4 @@ counts: Counts;

* set in the options, then passing test points will also be tracked.
*
* @group Test Reflection
*/

@@ -222,2 +240,4 @@ lists: Lists;

* the name of this test
*
* @group Test Reflection
*/

@@ -227,2 +247,4 @@ name: string;

* Set on completion. The results of the test run.
*
* @group Test Reflection
*/

@@ -232,2 +254,4 @@ results?: FinalResults;

* Parent test of this TAP stream
*
* @group Internal Machinery
*/

@@ -255,2 +279,4 @@ parent?: Base | TestBase;

* Unrecoverable TAP protocol errors in the stream
*
* @group Test Reflection
*/

@@ -271,2 +297,6 @@ errors: TapError[];

* the TAP stream data for buffered tests
*
* @internal
*
* @group Internal Machinery
*/

@@ -278,2 +308,4 @@ output: string;

* @internal
*
* @group Internal Machinery
*/

@@ -283,2 +315,4 @@ buffered: boolean;

* True if this test emitted a bailout
*
* @group Test Reflection
*/

@@ -288,2 +322,4 @@ bailedOut: string | boolean;

* high resolution bigint time when this test started
*
* @group Internal Machinery
*/

@@ -293,2 +329,4 @@ start: bigint;

* Amount of time in milliseconds that this test took to complete.
*
* @group Test Reflection
*/

@@ -298,2 +336,4 @@ time: MILLISECONDS;

* High resolution time in ns that this test took to complete.
*
* @group Test Reflection
*/

@@ -307,2 +347,4 @@ hrtime: bigint;

* A `Deferred` promise wrapper that is resolved when this test completes.
*
* @group Internal Machinery
*/

@@ -319,2 +361,4 @@ deferred?: Deferred<FinalResults>;

* indefinitely.
*
* @group Test Lifecycle Management
*/

@@ -328,2 +372,4 @@ setTimeout(n: MILLISECONDS): void;

* @internal
*
* @group Internal Machinery
*/

@@ -340,6 +386,10 @@ timeout(options?: {

* @internal
*
* @group Internal Machinery
*/
runMain(cb: () => void): void;
/**
* getter for the high resolution time when this test began
* Returns true if this test has begun
*
* @group Test Reflection
*/

@@ -349,2 +399,4 @@ get started(): boolean;

* True if the test has printed *some* output of any kind
*
* @group Test Reflection
*/

@@ -355,2 +407,6 @@ get printedOutput(): boolean;

* implement this in their specific ways.
*
* @internal
*
* @group Internal Machinery
*/

@@ -365,2 +421,9 @@ main(cb: () => void): void;

* called.
*
* Note: you *probably* never need to call this. Instead, use the various
* assertion methods and other parts of the API.
*
* @internal
*
* @group Internal Machinery
*/

@@ -379,2 +442,6 @@ write(c: string): boolean;

* {@link @tapjs/core!tap.TAP} classes
*
* @internal
*
* @group Internal Machinery
*/

@@ -388,2 +455,6 @@ oncomplete(results: FinalResults): void;

* the TAP stream.
*
* @internal
*
* @group Internal Machinery
*/

@@ -394,2 +465,6 @@ onbeforeend(): Promise<void> | void;

* is completely done, and terminating its parser.
*
* @internal
*
* @group Internal Machinery
*/

@@ -402,2 +477,4 @@ onEOF(): Promise<void> | void;

* @internal
*
* @group Internal Machinery
*/

@@ -409,2 +486,6 @@ ondone(): void;

* {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.
*
* @internal
*
* @group Internal Machinery
*/

@@ -425,2 +506,4 @@ emit<Event extends keyof Events>(ev: Event, ...data: Events[Event]): boolean;

* @internal
*
* @group Internal Machinery
*/

@@ -430,2 +513,4 @@ threw(er: any, extra?: Extra, proxy?: boolean, ended?: boolean): Extra | void | undefined;

* returns true if the test has not as yet encountered any failures
*
* @group Test Reflection
*/

@@ -432,0 +517,0 @@ passing(): boolean;

@@ -57,2 +57,4 @@ /**

* TapWrap AsyncResource that limits the async-hook-domain
*
* @group Internal Machinery
*/

@@ -64,2 +66,4 @@ hook;

* the async-hook-domain that catches throws and Promise rejections
*
* @group Internal Machinery
*/

@@ -69,2 +73,4 @@ hookDomain;

* The timer that fires when the test times out
*
* @group Internal Machinery
*/

@@ -79,2 +85,4 @@ timer;

* The tap parser attached to this TAP stream
*
* @group Internal Machinery
*/

@@ -89,2 +97,4 @@ parser;

* The count of all assertions that this stream emitted
*
* @group Test Reflection
*/

@@ -95,2 +105,4 @@ counts;

* set in the options, then passing test points will also be tracked.
*
* @group Test Reflection
*/

@@ -100,2 +112,4 @@ lists;

* the name of this test
*
* @group Test Reflection
*/

@@ -105,2 +119,4 @@ name;

* Set on completion. The results of the test run.
*
* @group Test Reflection
*/

@@ -110,2 +126,4 @@ results;

* Parent test of this TAP stream
*
* @group Internal Machinery
*/

@@ -133,2 +151,4 @@ parent;

* Unrecoverable TAP protocol errors in the stream
*
* @group Test Reflection
*/

@@ -149,2 +169,6 @@ errors;

* the TAP stream data for buffered tests
*
* @internal
*
* @group Internal Machinery
*/

@@ -156,2 +180,4 @@ output;

* @internal
*
* @group Internal Machinery
*/

@@ -161,2 +187,4 @@ buffered;

* True if this test emitted a bailout
*
* @group Test Reflection
*/

@@ -166,2 +194,4 @@ bailedOut;

* high resolution bigint time when this test started
*
* @group Internal Machinery
*/

@@ -172,2 +202,4 @@ start;

* Amount of time in milliseconds that this test took to complete.
*
* @group Test Reflection
*/

@@ -177,2 +209,4 @@ time;

* High resolution time in ns that this test took to complete.
*
* @group Test Reflection
*/

@@ -186,2 +220,4 @@ hrtime;

* A `Deferred` promise wrapper that is resolved when this test completes.
*
* @group Internal Machinery
*/

@@ -297,2 +333,4 @@ deferred;

* indefinitely.
*
* @group Test Lifecycle Management
*/

@@ -320,2 +358,4 @@ setTimeout(n) {

* @internal
*
* @group Internal Machinery
*/

@@ -351,2 +391,4 @@ timeout(options = {

* @internal
*
* @group Internal Machinery
*/

@@ -360,3 +402,5 @@ runMain(cb) {

/**
* getter for the high resolution time when this test began
* Returns true if this test has begun
*
* @group Test Reflection
*/

@@ -368,2 +412,4 @@ get started() {

* True if the test has printed *some* output of any kind
*
* @group Test Reflection
*/

@@ -376,2 +422,6 @@ get printedOutput() {

* implement this in their specific ways.
*
* @internal
*
* @group Internal Machinery
*/

@@ -388,2 +438,9 @@ main(cb) {

* called.
*
* Note: you *probably* never need to call this. Instead, use the various
* assertion methods and other parts of the API.
*
* @internal
*
* @group Internal Machinery
*/

@@ -411,2 +468,4 @@ write(c) {

* @internal
*
* @group Internal Machinery
*/

@@ -422,2 +481,6 @@ #online(line) {

* {@link @tapjs/core!tap.TAP} classes
*
* @internal
*
* @group Internal Machinery
*/

@@ -457,2 +520,6 @@ oncomplete(results) {

* the TAP stream.
*
* @internal
*
* @group Internal Machinery
*/

@@ -463,2 +530,6 @@ onbeforeend() { }

* is completely done, and terminating its parser.
*
* @internal
*
* @group Internal Machinery
*/

@@ -471,2 +542,4 @@ onEOF() { }

* @internal
*
* @group Internal Machinery
*/

@@ -478,2 +551,6 @@ ondone() { }

* {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.
*
* @internal
*
* @group Internal Machinery
*/

@@ -504,2 +581,4 @@ emit(ev, ...data) {

* @internal
*
* @group Internal Machinery
*/

@@ -567,2 +646,4 @@ threw(er, extra, proxy = false, ended = false) {

* returns true if the test has not as yet encountered any failures
*
* @group Test Reflection
*/

@@ -569,0 +650,0 @@ passing() {

@@ -29,2 +29,5 @@ import * as stack from '@tapjs/stack';

}
if (res.errorOrigin && typeof res.errorOrigin === 'object') {
res.errorOrigin = cleanYamlObject(res.errorOrigin);
}
if (res.at &&

@@ -31,0 +34,0 @@ res.at instanceof stack.CallSiteLike &&

@@ -10,2 +10,3 @@ /**

export * from './counts.js';
export * from './extra-from-error.js';
export * from './lists.js';

@@ -47,2 +48,7 @@ export * from './main-script.js';

source?: string;
errorOrigin?: {
at?: CallSiteLike | CallSiteLikeJSON | null;
stack?: string;
source?: string;
};
found?: any;

@@ -49,0 +55,0 @@ wanted?: any;

@@ -9,2 +9,3 @@ /**

export * from './counts.js';
export * from './extra-from-error.js';
export * from './lists.js';

@@ -11,0 +12,0 @@ export * from './main-script.js';

@@ -17,2 +17,5 @@ import { PromiseWithSubtest, TestBase, TestBaseOpts } from './test-base.js';

constructor(opts: TestBaseOpts);
/**
* Spawn a subtest that is also a {@link @tapjs/core!minimal.Minimal}
*/
test(name: string, extra: TestBaseOpts, cb: (t: Minimal) => any): PromiseWithSubtest<Minimal>;

@@ -19,0 +22,0 @@ test(name: string, cb: (t: Minimal) => any): PromiseWithSubtest<Minimal>;

@@ -30,2 +30,4 @@ /// <reference types="node" resolution-mode="require"/>

* @internal
*
* @group Internal Machinery
*/

@@ -146,4 +148,11 @@ cb?: (...args: any[]) => any;

* or during plugin setup time, this will be undefined, so watch out.
*
* @group Test Reflection
*/
t: Test;
/**
* A promise that resolves when the test is done.
*
* @group Internal Machinery
*/
donePromise?: Promise<any> & {

@@ -154,2 +163,4 @@ tapAbortPromise?: () => void;

* The number of subtests to run in parallel, if allowed
*
* @group Test Lifecycle Management
*/

@@ -160,2 +171,4 @@ jobs: number;

* and have not yet completed.
*
* @group Internal Machinery
*/

@@ -165,2 +178,4 @@ subtests: Base[];

* The pool of parallel tests currently in process
*
* @group Internal Machinery
*/

@@ -171,2 +186,4 @@ pool: Set<Base>;

* {@link @tapjs/core!test-base.QueueEntry} item.
*
* @group Internal Machinery
*/

@@ -176,2 +193,6 @@ queue: QueueEntry[];

* Function that will get this test as an argument when it is processed
*
* @internal
*
* @group Internal Machinery
*/

@@ -181,2 +202,4 @@ cb?: (...args: any[]) => any;

* The count of all assertions this test has seen
*
* @group Test Reflection
*/

@@ -195,2 +218,4 @@ count: number;

* Subtests that are currently in process.
*
* @group Internal Machinery
*/

@@ -201,2 +226,4 @@ activeSubtests: Set<Base>;

* excluding child test summary points
*
* @group Test Reflection
*/

@@ -206,2 +233,4 @@ assertTotals: Counts;

* true if the test has printed at least one TestPoint
*
* @group Test Reflection
*/

@@ -211,2 +240,4 @@ get printedResult(): boolean;

* true if the test is currently waiting for something to finish
*
* @group Test Reflection
*/

@@ -219,3 +250,3 @@ get occupied(): boolean;

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -232,4 +263,2 @@ bailout(message?: string): void;

* to standard output.
*
* @group TAP generation methods
*/

@@ -241,3 +270,5 @@ comment(...args: any[]): void;

*
* @group TAP generation methods
* @internal
*
* @group Internal Machinery
*/

@@ -250,4 +281,2 @@ timeout(options?: Extra & {

* Only `strict` is supported by the parser.
*
* @group TAP generation methods
*/

@@ -261,3 +290,3 @@ pragma(set: {

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -269,3 +298,3 @@ plan(n: number, comment?: string): void;

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -276,14 +305,12 @@ pass(...[msg, extra]: MessageExtra): boolean;

*
* @group TAP generation methods
* @group Assertion Methods
*/
fail(...[msg, extra]: MessageExtra): boolean;
/**
* The current assertion being processed. May only be set if
* not already set.
* The current assertion being processed. Set at the start of all
* assertions, and used for calculating stack traces.
*
* @group Internal Machinery
*/
get currentAssert(): null | Function | ((...a: any[]) => any);
/**
* The current assertion being processed. May only be set if
* not already set.
*/
set currentAssert(fn: null | Function | ((...a: any[]) => any));

@@ -297,3 +324,3 @@ /**

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -305,6 +332,9 @@ end(implicit?: typeof IMPLICIT): this;

*
* This is primarily internal, but is used in some plugins, whenever
* a promise must be awaited before proceeding. In normal test usage,
* it's usually best to simply use an async test function and `await`
* promises as normal.
* This is internal, used in some plugins when a promise must be awaited
* before proceeding. In normal test usage, it's usually best to simply use
* an async test function and `await` promises as normal.
*
* @internal
*
* @group Internal Machinery
*/

@@ -326,2 +356,4 @@ waitOn(promise: Promise<any | void>, cb?: (w: Waiter) => any, expectReject?: boolean): Promise<void>;

* @internal
*
* @group Internal Machinery
*/

@@ -332,2 +364,4 @@ main(cb: () => void): void;

* If used, then no other subtests or assertions are allowed.
*
* @group Subtest Methods
*/

@@ -343,2 +377,4 @@ stdinOnly<T extends BaseOpts>(extra?: T & {

*
* @group Subtest Methods
*
* @internal

@@ -356,2 +392,4 @@ */

* @internal
*
* @group Internal Machinery
*/

@@ -361,2 +399,15 @@ threw(er: any, extra?: Extra, proxy?: boolean): Extra | void | undefined;

* Method called when the parser encounters a bail out
*
* To listen to bailout events, listen to the
* {@link @tapjs/core!base.TapBaseEvents#bailout} event:
*
* ```ts
* t.on('bailout', message => {
* // test bailed out!
* })
* ```
*
* @internal
*
* @group Internal Machinery
*/

@@ -372,2 +423,6 @@ onbail(message?: string): void;

* indefinitely.
*
* @internal
*
* @group Internal Machinery
*/

@@ -378,2 +433,6 @@ endAll(sub?: boolean): void;

* should be skipped. Extended by the `@tapjs/filter` plugin.
*
* @internal
*
* @group Internal Machinery
*/

@@ -380,0 +439,0 @@ shouldSkipChild<O extends BaseOpts>(extra: O | TestBaseOpts | BaseOpts): boolean;

@@ -42,7 +42,16 @@ import * as stack from '@tapjs/stack';

* or during plugin setup time, this will be undefined, so watch out.
*
* @group Test Reflection
*/
t;
/**
* A promise that resolves when the test is done.
*
* @group Internal Machinery
*/
donePromise;
/**
* The number of subtests to run in parallel, if allowed
*
* @group Test Lifecycle Management
*/

@@ -53,2 +62,4 @@ jobs;

* and have not yet completed.
*
* @group Internal Machinery
*/

@@ -58,2 +69,4 @@ subtests = [];

* The pool of parallel tests currently in process
*
* @group Internal Machinery
*/

@@ -64,2 +77,4 @@ pool = new Set();

* {@link @tapjs/core!test-base.QueueEntry} item.
*
* @group Internal Machinery
*/

@@ -69,2 +84,6 @@ queue = [VERSION];

* Function that will get this test as an argument when it is processed
*
* @internal
*
* @group Internal Machinery
*/

@@ -74,2 +93,4 @@ cb;

* The count of all assertions this test has seen
*
* @group Test Reflection
*/

@@ -104,2 +125,4 @@ count = 0;

* Subtests that are currently in process.
*
* @group Internal Machinery
*/

@@ -110,2 +133,4 @@ activeSubtests = new Set();

* excluding child test summary points
*
* @group Test Reflection
*/

@@ -121,2 +146,4 @@ assertTotals = new Counts({

* true if the test has printed at least one TestPoint
*
* @group Test Reflection
*/

@@ -128,2 +155,4 @@ get printedResult() {

* true if the test is currently waiting for something to finish
*
* @group Test Reflection
*/

@@ -150,3 +179,2 @@ get occupied() {

}
// TAP output generating methods
/**

@@ -156,3 +184,3 @@ * immediately exit this and all parent tests with a TAP

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -181,4 +209,2 @@ bailout(message) {

* to standard output.
*
* @group TAP generation methods
*/

@@ -214,3 +240,5 @@ comment(...args) {

*
* @group TAP generation methods
* @internal
*
* @group Internal Machinery
*/

@@ -230,4 +258,2 @@ timeout(options = { expired: this.name }) {

* Only `strict` is supported by the parser.
*
* @group TAP generation methods
*/

@@ -271,3 +297,3 @@ pragma(set) {

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -284,3 +310,3 @@ pass(...[msg, extra]) {

*
* @group TAP generation methods
* @group Assertion Methods
*/

@@ -295,4 +321,6 @@ fail(...[msg, extra]) {

/**
* The current assertion being processed. May only be set if
* not already set.
* The current assertion being processed. Set at the start of all
* assertions, and used for calculating stack traces.
*
* @group Internal Machinery
*/

@@ -302,6 +330,2 @@ get currentAssert() {

}
/**
* The current assertion being processed. May only be set if
* not already set.
*/
set currentAssert(fn) {

@@ -315,5 +339,5 @@ if (!this.#currentAssert && typeof fn === 'function') {

*
* @group TAP generation methods
* @internal
*
* @internal
* @group Internal Machinery
*/

@@ -432,3 +456,3 @@ #printResult(ok, message, extra, front = false) {

*
* @group TAP generation methods
* @group Test Lifecycle Management
*/

@@ -443,2 +467,4 @@ end(implicit) {

* @internal
*
* @group Internal Machinery
*/

@@ -459,6 +485,9 @@ #writeSubComment(p) {

*
* This is primarily internal, but is used in some plugins, whenever
* a promise must be awaited before proceeding. In normal test usage,
* it's usually best to simply use an async test function and `await`
* promises as normal.
* This is internal, used in some plugins when a promise must be awaited
* before proceeding. In normal test usage, it's usually best to simply use
* an async test function and `await` promises as normal.
*
* @internal
*
* @group Internal Machinery
*/

@@ -773,2 +802,4 @@ waitOn(promise, cb, expectReject = false) {

* @internal
*
* @group Internal Machinery
*/

@@ -863,2 +894,4 @@ main(cb) {

* If used, then no other subtests or assertions are allowed.
*
* @group Subtest Methods
*/

@@ -915,2 +948,4 @@ stdinOnly(extra) {

*
* @group Subtest Methods
*
* @internal

@@ -982,2 +1017,4 @@ */

* @internal
*
* @group Internal Machinery
*/

@@ -1062,2 +1099,15 @@ threw(er, extra, proxy = false) {

* Method called when the parser encounters a bail out
*
* To listen to bailout events, listen to the
* {@link @tapjs/core!base.TapBaseEvents#bailout} event:
*
* ```ts
* t.on('bailout', message => {
* // test bailed out!
* })
* ```
*
* @internal
*
* @group Internal Machinery
*/

@@ -1079,2 +1129,6 @@ onbail(message) {

* indefinitely.
*
* @internal
*
* @group Internal Machinery
*/

@@ -1123,2 +1177,6 @@ endAll(sub = false) {

* should be skipped. Extended by the `@tapjs/filter` plugin.
*
* @internal
*
* @group Internal Machinery
*/

@@ -1125,0 +1183,0 @@ shouldSkipChild(extra) {

{
"name": "@tapjs/core",
"version": "0.0.0-12",
"version": "0.0.0-13",
"description": "pluggable core of node-tap",

@@ -51,6 +51,6 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)",

"@tapjs/stack": "0.0.0-4",
"@tapjs/test": "0.0.0-12",
"@tapjs/test": "0.0.0-13",
"async-hook-domain": "^4.0.1",
"is-actual-promise": "^1.0.0",
"jackspeak": "^2.2.3",
"jackspeak": "2.3",
"minipass": "^7.0.3",

@@ -57,0 +57,0 @@ "signal-exit": "4.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc