From b4fb6305a77c4575126fd37e8e73f0237496bd70 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 8 Mar 2024 10:04:12 -0800 Subject: [PATCH] allow setting fields on t.context in t.before() Fix: #998 --- src/core/dist/commonjs/base.d.ts | 9 ++------- src/core/dist/commonjs/base.d.ts.map | 2 +- src/core/dist/commonjs/base.js | 17 +++++++++++++---- src/core/dist/commonjs/base.js.map | 2 +- src/core/dist/esm/base.d.ts | 9 ++------- src/core/dist/esm/base.d.ts.map | 2 +- src/core/dist/esm/base.js | 17 +++++++++++++---- src/core/dist/esm/base.js.map | 2 +- src/core/src/base.ts | 15 ++++++++++++--- src/core/tap-snapshots/test/base.ts.test.cjs | 4 ++-- src/core/test/base.ts | 9 +++++++++ 11 files changed, 57 insertions(+), 31 deletions(-) diff --git a/src/core/dist/commonjs/base.d.ts b/src/core/dist/commonjs/base.d.ts index 81a4b4d9e..4a4f63a13 100644 --- a/src/core/dist/commonjs/base.d.ts +++ b/src/core/dist/commonjs/base.d.ts @@ -295,13 +295,8 @@ export declare class Base extends * Numeric identifier for this test */ childId: number; - /** - * Any arbitrary data that is provided to this test object. Often, this - * is set in a `t.before()` or `t.beforeEach()` method. Scalar values - * are inherited by child tests. Object values are extended in child - * tests using `Object.create()`. - */ - context: any; + get context(): any; + set context(c: any); /** * the TAP stream data for buffered tests * diff --git a/src/core/dist/commonjs/base.d.ts.map b/src/core/dist/commonjs/base.d.ts.map index 5943feecc..03fc9b2a7 100644 --- a/src/core/dist/commonjs/base.d.ts.map +++ b/src/core/dist/commonjs/base.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAGnC,OAAO,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onjs/base.js index 6d378bf07..0e3049ecb 100644 --- a/src/core/dist/commonjs/base.js +++ b/src/core/dist/commonjs/base.js @@ -17,6 +17,7 @@ const diags_js_1 = require("./diags.js"); const extra_from_error_js_1 = require("./extra-from-error.js"); const lists_js_1 = require("./lists.js"); const message_from_error_js_1 = require("./message-from-error.js"); +const unsetContext = Symbol('TAP.context unset'); /** * Wrapper for the async-hook-domain that catches errors thrown during * test operation. @@ -164,7 +165,15 @@ class Base extends minipass_1.Minipass { * are inherited by child tests. Object values are extended in child * tests using `Object.create()`. */ - context; + #context = unsetContext; + get context() { + if (this.#context === unsetContext) + this.#context = Object.create(null); + return this.#context; + } + set context(c) { + this.#context = c; + } /** * the TAP stream data for buffered tests * @@ -392,12 +401,12 @@ class Base extends minipass_1.Minipass { this.start = node_process_1.hrtime.bigint(); this.#started = true; // if it's null or an object, inherit from it. otherwise, copy it. - const ctx = this.context ?? + const ctx = this.#context !== unsetContext ? this.#context : ('context' in this.options ? this.options.context : this.parent?.context) ?? - null; - this.context = typeof ctx === 'object' ? Object.create(ctx) : ctx; + null; + this.#context = typeof ctx === 'object' ? Object.create(ctx) : ctx; this.hook.runInAsyncScope(this.main, this, cb); } /** diff --git a/src/core/dist/commonjs/base.js.map b/src/core/dist/commonjs/base.js.map index f179cc928..15b079bf9 100644 --- a/src/core/dist/commonjs/base.js.map +++ b/src/core/dist/commonjs/base.js.map @@ -1 +1 @@ -{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yDAA0C;AAC1C,6CAA2C;AAC3C,uCAAmC;AACnC,+CAAqC;AACrC,yCAAkC;AAClC,2CAAmE;AAEnE,2CAAoC;AACpC,yCAAkC;AAClC,+DAAsD;AAEtD,yCAAkC;AAClC,mEAA0D;AAoB1D;;;;;GAKG;AACH,MAAa,OAAQ,SAAQ,2BAAa;IACxC,IAAI,CAAM;IACV,SAAS,CAAa;IACtB,YAAY,IAAU;QACpB,KA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AM,cAAc,GAClB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC;YACzC,IAAI,CAAC,MAAM,CAAC,SAAS;YACrB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAA;QACvB,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,CAAA;QACzC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;SACnC;aAAM,IAAI,CAAC,cAAc,EAAE;YAC1B,6DAA6D;YAC7D,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;aAClB;iBAAM;gBACL,qBAAqB;gBACrB,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,OAAO,CAAA;gBAC/B,oBAAoB;gBACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;gBAC5C,OAAO,CAAC,KAAK,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAA;aAC5B;SACF;QACD,yDAAyD;QACzD,iDAAiD;IACnD,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,CAAA;IACrD,CAAC;CACF;AAtqBD,oBAsqBC","sourcesContent":["/**\n * The base class that is extended by all TAP-generating classes\n *\n * @module\n */\n\nimport { Domain } from 'async-hook-domain'\nimport { AsyncResource } from 'async_hooks'\nimport { Minipass } from 'minipass'\nimport { hrtime } from 'node:process'\nimport { format } from 'node:util'\nimport { FinalResults, Parser, Result, TapError } from 'tap-parser'\nimport { Deferred } from 'trivial-deferred'\nimport { Counts } from './counts.js'\nimport { diags } from './diags.js'\nimport { extraFromError } from './extra-from-error.js'\nimport type { Extra, TestBase } from './index.js'\nimport { Lists } from './lists.js'\nimport { messageFromError } from './message-from-error.js'\n\n/**\n * Events emitted by the Base class\n */\nexport interface TapBaseEvents extends Minipass.Events {\n /**\n * emitted when a timeout occurs\n */\n timeout: [threw?: Extra]\n /**\n * emitted when the test bails out\n */\n bailout: [reason?: string]\n /**\n * emitted when the test is complete\n */\n complete: [results: FinalResults]\n}\n\n/**\n * Wrapper for the async-hook-domain that catches errors thrown during\n * test operation.\n *\n * @see {@link https://npmjs.com/async-hook-domain}\n */\nexport class TapWrap extends AsyncResource {\n test: Base\n onDestroy?: () => void\n constructor(test: Base) {\n super(`tap.${test.constructor.name}`)\n this.test = test\n }\n emitDestroy() {\n this.onDestroy?.()\n super.emitDestroy()\n return this\n }\n}\n\nconst debug =\n (name: string) =>\n (...args: any[]) => {\n const prefix = `TAP ${process.pid} ${name}: `\n const msg = format(...args).trim()\n console.error(prefix + msg.split('\\n').join(`\\n${prefix}`))\n }\n\n/**\n * A number indicating an amount of milliseconds\n */\nexport type MILLISECONDS = number\n\n/**\n * Options that may be passed to any TAP-generating class\n */\nexport interface BaseOpts extends Extra {\n /**\n * Bail out on the first failure\n */\n bail?: boolean\n /**\n * Treat any unknown non-TAP data as an error\n * May be set at run-time by the TAP stream using `pragma +strict`\n */\n strict?: boolean\n /**\n * Do not emit the `TAP version 14` line.\n */\n omitVersion?: boolean\n /**\n * Do not elide empty lines and other unnecessary whitespace\n */\n preserveWhitespace?: boolean\n /**\n * Skip this test entirely, emitting a `# SKIP` directive\n */\n skip?: boolean | string\n /**\n * Mark this test as to be done later, emitting a `# TODO` directive\n */\n todo?: boolean | string\n /**\n * Amount of time in milliseconds before this test times out\n */\n timeout?: MILLISECONDS\n\n /**\n * track passes in the results lists, default false\n */\n passes?: boolean\n\n /**\n * treat todo tests as failures, default false\n */\n failTodo?: boolean\n\n /**\n * treat skip tests as failures, default false\n */\n failSkip?: boolean\n\n /**\n * The amount of time that this test took to complete.\n *\n * Typically, this is not set explicitly, but inferred from the actual\n * time spent. However in some cases, it may be reported by the\n * top-level `# time=...` comment in a TAP subprocess stream.\n */\n time?: number\n /**\n * The TAP data from a buffered test.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n tapChildBuffer?: string\n /**\n * The stack where this test was initiated\n */\n stack?: string\n\n /**\n * Parent test of this test\n */\n parent?: Base | TestBase\n /**\n * The name of this test\n */\n name?: string\n /**\n * Numeric identifier attached to child tests. Most of the time, this is\n * set based on the `TAP_CHILD_ID` environment variable.\n */\n childId?: number\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n *\n * If not set in the options, this is initialized to a null-prototyped\n * object, so that usage like `t.context.foo = 'bar'` will work as expected.\n *\n * This is initialized and set on the Test object in the `runMain` method,\n * *not* at construction time. If set explicitly on the Test object in a\n * `before` hook, then any context specified on options or inherited from\n * the parent test will be ignored.\n */\n context?: any\n /**\n * Number of spaces that this test is indented.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n indent?: string\n /**\n * True to output LOTS AND LOTS of noisy debugging information.\n * Set at the top level by the `TAP_DEBUG` environment variable.\n */\n debug?: boolean\n /**\n * Parser to use for this TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n parser?: Parser\n /**\n * True if this test should be buffered, and only processed once\n * complete.\n *\n * Defaults to true when `t.jobs` is set to a value greater than 1.\n *\n * If set false in that case, then the test will NOT be run in parallel,\n * so this provides a way to control the parallelism within a test suite.\n */\n buffered?: boolean\n\n /**\n * Setting silent:true in a subtest option makes it completely excluded\n * from test output, UNLESS it fails.\n *\n * This was used historically for a few things which are now implemented\n * with a more sophisticated promise management system, but can be handy in\n * some rare situations.\n */\n silent?: boolean\n}\n\nexport class Base<\n Events extends TapBaseEvents = TapBaseEvents\n> extends Minipass {\n /**\n * Set upon test completion when a child test is ready to be processed by its\n * parent.\n */\n readyToProcess: boolean = false\n /**\n * Options provided to this test\n */\n options: BaseOpts\n /**\n * number of spaces to indent the TAP stream\n */\n indent: string\n /**\n * TapWrap AsyncResource that limits the async-hook-domain\n *\n * @group Internal Machinery\n */\n hook: TapWrap\n // this actually is deterministically set in the ctor, but\n // in the hook, so tsc doesn't see it.\n /**\n * the async-hook-domain that catches throws and Promise rejections\n *\n * @group Internal Machinery\n */\n hookDomain!: Domain\n /**\n * The timer that fires when the test times out\n *\n * @group Internal Machinery\n */\n timer?: NodeJS.Timeout\n\n /**\n * Set to true when the test times out, so its failure status can be\n * determined later.\n */\n timedOut: boolean = false\n /**\n * The tap parser attached to this TAP stream\n *\n * @group Internal Machinery\n */\n parser: Parser\n /**\n * Method that writes to stderr when `debug: true` is set in the options,\n * or no-ops otherwise\n */\n debug: (...args: any[]) => void\n /**\n * The count of all assertions that this stream emitted\n *\n * @group Test Reflection\n */\n counts: Counts\n /**\n * Lists of todo, skip, and failure test points. If `passes: true` is\n * set in the options, then passing test points will also be tracked.\n *\n * @group Test Reflection\n */\n lists: Lists\n /**\n * the name of this test\n *\n * @group Test Reflection\n */\n name: string\n /**\n * Set on completion. The results of the test run.\n *\n * @group Test Reflection\n */\n results?: FinalResults\n /**\n * Parent test of this TAP stream\n *\n * @group Internal Machinery\n */\n parent?: Base | TestBase\n\n /**\n * Nesting level, for serialization to node test runner\n *\n * Note that this is zero for parent-less tests, and *also* zero\n * for the first level of children.\n */\n nestingLevel: number = 0\n\n /**\n * Bail out on the first failed test point\n */\n bail: boolean\n /**\n * Treat non-TAP data as an error.\n * May be set with `pragma +strict` in the TAP stream, or unset with\n * `pragma: -strict`.\n */\n strict: boolean\n /**\n * Do not emit the `TAP version 14` line at the start\n */\n omitVersion: boolean\n /**\n * Do not elide extraneous whitespace and empty lines.\n */\n preserveWhitespace: boolean\n\n /**\n * Unrecoverable TAP protocol errors in the stream\n *\n * @group Test Reflection\n */\n errors: TapError[]\n\n /**\n * Numeric identifier for this test\n */\n childId: number\n\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n */\n context: any\n\n /**\n * the TAP stream data for buffered tests\n *\n * @internal\n *\n * @group Internal Machinery\n */\n output: string\n\n /**\n * True if this test should be buffered and only processed on completion\n *\n * @internal\n *\n * @group Internal Machinery\n */\n buffered: boolean\n\n /**\n * True if this test emitted a bailout\n *\n * @group Test Reflection\n */\n bailedOut: string | boolean\n\n /**\n * high resolution bigint time when this test started\n *\n * @group Internal Machinery\n */\n start: bigint\n #started: boolean = false\n\n /**\n * Amount of time in milliseconds that this test took to complete.\n *\n * @group Test Reflection\n */\n time: MILLISECONDS\n\n /**\n * High resolution time in ns that this test took to complete.\n *\n * @group Test Reflection\n */\n hrtime: bigint\n\n /**\n * True if this test should be buffered and only emit data if it fails\n */\n silent: boolean\n\n /**\n * A `Deferred` promise wrapper that is resolved when this test completes.\n *\n * @group Internal Machinery\n */\n deferred?: Deferred\n\n #printedOutput: boolean = false\n\n #writable: boolean = true\n\n constructor(options: BaseOpts = {}) {\n super({ encoding: 'utf8' })\n // always use the constructor name as toStringTag, so we get\n // [object Test] or [object TAP] and the appropriate typeName\n // in stack traces.\n Object.defineProperty(this, Symbol.toStringTag, {\n value: this.constructor.name,\n configurable: true,\n })\n // all tap streams are sync string minipasses\n this.hook = new TapWrap(this)\n this.options = options\n this.counts = new Counts()\n this.lists = new Lists()\n\n this.silent = !!options.silent\n\n this.bail = !!options.bail\n this.strict = !!options.strict\n this.omitVersion = !!options.omitVersion\n this.preserveWhitespace = options.preserveWhitespace !== false\n this.buffered = this.silent\n ? options.buffered === undefined\n : !!options.buffered\n this.bailedOut = false\n this.errors = []\n this.parent = options.parent\n if (this.parent?.parent) {\n this.nestingLevel = this.parent.nestingLevel + 1\n }\n\n this.time = 0\n this.hrtime = 0n\n this.start = 0n\n this.childId = options.childId || 0\n // do we need this? couldn't we just call the Minipass\n this.output = ''\n this.indent = options.indent || ''\n this.name = options.name || '(unnamed test)'\n this.hook.runInAsyncScope(() => {\n this.hookDomain = new Domain((er, type) => {\n /* c8 ignore start */\n if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n /* c8 ignore stop */\n ;(er as { tapCaught?: string }).tapCaught = type\n this.threw(er)\n })\n })\n this.debug = !!options.debug ? debug(this.name) : () => {}\n\n this.parser =\n options.parser ||\n new Parser({\n bail: this.bail,\n strict: this.strict,\n omitVersion: this.omitVersion,\n preserveWhitespace: this.preserveWhitespace,\n passes: this.options.passes,\n name: this.name,\n })\n this.#setupParser()\n\n // ensure that a skip or todo on a child class reverts\n // back to Base's no-op main.\n if (options.skip || options.todo) {\n this.main = Base.prototype.main\n }\n }\n\n #isFilterSkip(res: Result) {\n return (\n typeof res.skip === 'string' &&\n /^filter: (only|\\/.*\\/)$/.test(res.skip)\n )\n }\n\n #onParserResult(res: Result) {\n this.counts.total++\n const type = res.todo\n ? 'todo'\n : res.skip\n ? 'skip'\n : !res.ok\n ? 'fail'\n : 'pass'\n this.counts[type]++\n if (type === 'pass' && this.options.passes) {\n this.lists.pass.push(res)\n } else if (type === 'todo') {\n this.lists.todo.push(res)\n } else if (type === 'skip') {\n if (!this.#isFilterSkip(res)) this.lists.skip.push(res)\n } else if (type === 'fail') {\n this.lists.fail.push(res)\n }\n }\n\n #setupParser() {\n this.parser.on('line', l => this.#online(l))\n this.parser.once('bailout', reason => this.onbail(reason))\n this.parser.on('complete', result => this.oncomplete(result))\n this.parser.on('result', res => this.#onParserResult(res))\n }\n\n /**\n * Set the amount of time in milliseconds before this test is considered\n * a timeout. The time is counted from right now, so for example, repeatedly\n * calling `t.setTimeout(100)` can keep it going indefinitely, as long as\n * you call it more often than every 100ms.\n *\n * Calling `setTimeout(0)` will remove the timer and allow the test to run\n * indefinitely.\n *\n * @group Test Lifecycle Management\n */\n setTimeout(n: MILLISECONDS) {\n if (this.timer) {\n clearTimeout(this.timer)\n }\n if (n <= 0) {\n this.timer = undefined\n delete this.options.timeout\n } else {\n this.options.timeout = n\n this.timer = setTimeout(() => this.timeout(), n)\n /* c8 ignore start */\n if (this.timer.unref) this.timer.unref()\n /* c8 ignore stop */\n }\n }\n\n /**\n * Called when a timeout occurs. Only exposed because it has to be called\n * and/or extended by other classes, which all have their own sorts of\n * timeout behavior specific to the type of thing they represent.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n timeout(\n options: { expired?: string; message?: string } = {\n expired: this.name,\n message: 'timeout!',\n }\n ) {\n this.timedOut = true\n const { message = 'timeout!' } = options\n this.setTimeout(0)\n options.expired = options.expired || this.name\n // timeouts don't generally have a useful callsite information,\n // and no sense trying to capture it from @tapjs/stack\n const extra: Extra = {\n ...options,\n message,\n stack: '',\n at: {},\n }\n\n const threw = this.threw({ message }, extra)\n delete extra.stack\n delete extra.at\n if (threw) {\n this.emit('timeout', threw)\n }\n }\n\n /**\n * Run the `main` test function. Called by\n * {@link @tapjs/core!test-base.TestBase} when starting a subtest.\n * Initializes the TapWrap hook\n *\n * @internal\n *\n * @group Internal Machinery\n */\n runMain(cb: () => void) {\n this.debug('BASE runMain')\n this.start = hrtime.bigint()\n this.#started = true\n\n // if it's null or an object, inherit from it. otherwise, copy it.\n const ctx =\n this.context ??\n ('context' in this.options\n ? this.options.context\n : this.parent?.context) ??\n null\n this.context = typeof ctx === 'object' ? Object.create(ctx) : ctx\n\n this.hook.runInAsyncScope(this.main, this, cb)\n }\n\n /**\n * Returns true if this test has begun\n *\n * @group Test Reflection\n */\n get started() {\n return this.#started\n }\n\n /**\n * True if the test has printed *some* output of any kind\n *\n * @group Test Reflection\n */\n get printedOutput() {\n return this.#printedOutput\n }\n\n /**\n * Boolean indicating whether the underlying stream can be written to,\n * or if it has been ended.\n */\n get streamWritable() {\n return this.#writable\n }\n\n /**\n * The main test function. For this Base class, this is a no-op. Subclasses\n * implement this in their specific ways.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n main(cb: () => void) {\n cb()\n }\n\n /**\n * Stream write method.\n *\n * For buffered tests, this collects the output in the\n * {@link @tapjs/core!base.Base#output}\n * field. Sets {@link @tapjs/core!base.Base#printedOutput} to `true` when\n * called.\n *\n * Note: you *probably* never need to call this. Instead, use the various\n * assertion methods and other parts of the API.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n write(c: string) {\n this.#printedOutput = true\n if (this.buffered || this.silent) {\n // need the silent output if it fails\n this.output += c\n return true\n }\n\n if (!this.#writable) {\n return false\n }\n\n return super.write(c)\n }\n\n /**\n * Method called when the parser encounters a bail out\n *\n * Extended by {@link @tapjs/core!test-base.TestBase}\n */\n onbail(reason?: string) {\n this.bailedOut = reason || true\n this.emit('bailout', reason)\n }\n\n /**\n * Method called when parser emits a line of TAP data\n *\n * @internal\n *\n * @group Internal Machinery\n */\n #online(line: string) {\n this.debug('LINE %j', line, [this.name, this.indent])\n return this.write(this.indent + line)\n }\n\n /**\n * Method called when the parser completes and emits its final results\n *\n * Extended by {@link @tapjs/core!worker.Worker} and\n * {@link @tapjs/core!tap.TAP} classes\n *\n * @internal\n *\n * @group Internal Machinery\n */\n oncomplete(results: FinalResults) {\n if (this.start) {\n this.hrtime = hrtime.bigint() - this.start\n this.time =\n results.time || Math.floor(Number(this.hrtime) / 1000) / 1000\n }\n\n this.debug('ONCOMPLETE %j %j', this.name, results)\n\n // should only ever happen once, but just in case\n /* c8 ignore start */\n if (this.results) {\n Object.assign(results, this.results)\n }\n /* c8 ignore stop */\n\n this.results = results\n this.emit('complete', results)\n const errors = results.failures\n .filter(f => f.tapError)\n .map(f => {\n delete f.diag\n delete f.ok\n return f\n })\n\n if (errors.length) {\n this.errors = errors\n }\n\n this.#writable = false\n super.end()\n }\n\n /**\n * extension point for plugins that want to be notified when the test\n * is about to end, whether explicitly or implicitly.\n *\n * If the function returns a Promise, it will be awaited before ending\n * the TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onbeforeend(): Promise | void {}\n\n /**\n * extension point for plugins that want to be notified when the test\n * is completely done, and terminating its parser.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onEOF(): Promise | void {}\n\n /**\n * extension point for TestBase to know when a child tests is done being\n * processed and it's safe to move on to the next one.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n ondone() {}\n\n /**\n * EventEmitter emit method, but closes the\n * {@link @tapjs/core!base.Base#hook} and\n * {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n emit(\n ev: Event,\n ...data: Events[Event]\n ) {\n const ret = super.emit(ev, ...data)\n if (ev === 'end') {\n this.ondone()\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n }\n return ret\n }\n\n /**\n * Mark the test as ended. In this base class, this is a no-op, but\n * in {@link @tapjs/core!test-base.TestBase}, it also triggers the other\n * end-of-test operations.\n */\n end() {\n return this\n }\n\n /**\n * Method called when an unrecoverable error is encountered in a test.\n *\n * Typically, in tests you would not call this, you'd just actually throw\n * an error.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n threw(\n er: any,\n extra?: Extra,\n proxy: boolean = false,\n ended: boolean = false\n ): Extra | void | undefined {\n this.debug('BASE.threw', er)\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n if (typeof er === 'string') {\n er = { message: er }\n } else if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n if (this.name && !proxy) {\n er.test = this.name\n }\n\n const message = messageFromError(er)\n if (!extra) {\n extra = extraFromError(er, extra)\n }\n extra.message = message\n\n this.parser.ok = false\n\n // if possible to handle it here, then return the info so that this\n // Base subclass can do its thing\n if (\n !ended &&\n !this.results &&\n /* c8 ignore start */\n (this.parser.planEnd === -1 ||\n this.parser.count < this.parser.planEnd)\n /* c8 ignore stop */\n ) {\n return extra\n }\n\n // if we ended, we have to report it SOMEWHERE, unless we're\n // already in the process of bailing out, in which case it's\n // a bit excessive. Do not print it here if it would trigger\n // a plan exceeded error, or if we already have results.\n this.debug(\n 'Base.threw, but finished',\n this.name,\n this.results,\n extra.message\n )\n const alreadyBailing =\n (this.results?.ok === false && this.bail) ||\n this.parser.bailedOut ||\n this.results?.bailout\n if (this.results) this.results.ok = false\n if (this.parent) {\n this.parent.threw(er, extra, true)\n } else if (!alreadyBailing) {\n // not already bailing out, so print the error as best we can\n if (!er.stack) {\n console.error(er)\n } else {\n /* c8 ignore start */\n const name = er.name || 'Error'\n /* c8 ignore stop */\n console.error('%s: %s', name, extra.message)\n console.error(diags(extra))\n }\n }\n // we are already bailing out, and this is the top level,\n // just make our way hastily to the nearest exit.\n }\n\n /**\n * returns true if the test has not as yet encountered any failures\n *\n * @group Test Reflection\n */\n passing() {\n return this.parser.ok && this.results?.ok !== false\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yDAA0C;AAC1C,6CAA2C;AAC3C,uCAAmC;AACnC,+CAAqC;AACrC,yCAAkC;AAClC,2CAAmE;AAEnE,2CAAoC;AACpC,yCAAkC;AAClC,+DAAsD;AAEtD,yCAAkC;AAClC,mEAA0D;AAE1D,MAAM,YAAY,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAoBhD;;;;;GAKG;AACH,MAAa,OAAQ,SAAQ,2BAAa;IACxC,IAAI,CAAM;IACV,SAAS,CAAa;IACtB,YAAY,IAAU;QACpB,KAAK,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAA;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IACD,WAAW;QACT,IAAI,CAAC,SAAS,EAAE,EAAE,CAAA;QAClB,KAAK,CAAC,WAAW,EAAE,CAAA;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAZD,0BAYC;AAED,MAAM,KAAK,GACT,CAAC,IAAY,EAAE,EAAE,CACjB,CAAC,GAAG,IAAW,EAAE,EAAE;IACjB,MAAM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c,GAClB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC;YACzC,IAAI,CAAC,MAAM,CAAC,SAAS;YACrB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAA;QACvB,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,CAAA;QACzC,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;SACnC;aAAM,IAAI,CAAC,cAAc,EAAE;YAC1B,6DAA6D;YAC7D,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;aAClB;iBAAM;gBACL,qBAAqB;gBACrB,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,OAAO,CAAA;gBAC/B,oBAAoB;gBACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;gBAC5C,OAAO,CAAC,KAAK,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAA;aAC5B;SACF;QACD,yDAAyD;QACzD,iDAAiD;IACnD,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,CAAA;IACrD,CAAC;CACF;AA7qBD,oBA6qBC","sourcesContent":["/**\n * The base class that is extended by all TAP-generating classes\n *\n * @module\n */\n\nimport { Domain } from 'async-hook-domain'\nimport { AsyncResource } from 'async_hooks'\nimport { Minipass } from 'minipass'\nimport { hrtime } from 'node:process'\nimport { format } from 'node:util'\nimport { FinalResults, Parser, Result, TapError } from 'tap-parser'\nimport { Deferred } from 'trivial-deferred'\nimport { Counts } from './counts.js'\nimport { diags } from './diags.js'\nimport { extraFromError } from './extra-from-error.js'\nimport type { Extra, TestBase } from './index.js'\nimport { Lists } from './lists.js'\nimport { messageFromError } from './message-from-error.js'\n\nconst unsetContext = Symbol('TAP.context unset')\n\n/**\n * Events emitted by the Base class\n */\nexport interface TapBaseEvents extends Minipass.Events {\n /**\n * emitted when a timeout occurs\n */\n timeout: [threw?: Extra]\n /**\n * emitted when the test bails out\n */\n bailout: [reason?: string]\n /**\n * emitted when the test is complete\n */\n complete: [results: FinalResults]\n}\n\n/**\n * Wrapper for the async-hook-domain that catches errors thrown during\n * test operation.\n *\n * @see {@link https://npmjs.com/async-hook-domain}\n */\nexport class TapWrap extends AsyncResource {\n test: Base\n onDestroy?: () => void\n constructor(test: Base) {\n super(`tap.${test.constructor.name}`)\n this.test = test\n }\n emitDestroy() {\n this.onDestroy?.()\n super.emitDestroy()\n return this\n }\n}\n\nconst debug =\n (name: string) =>\n (...args: any[]) => {\n const prefix = `TAP ${process.pid} ${name}: `\n const msg = format(...args).trim()\n console.error(prefix + msg.split('\\n').join(`\\n${prefix}`))\n }\n\n/**\n * A number indicating an amount of milliseconds\n */\nexport type MILLISECONDS = number\n\n/**\n * Options that may be passed to any TAP-generating class\n */\nexport interface BaseOpts extends Extra {\n /**\n * Bail out on the first failure\n */\n bail?: boolean\n /**\n * Treat any unknown non-TAP data as an error\n * May be set at run-time by the TAP stream using `pragma +strict`\n */\n strict?: boolean\n /**\n * Do not emit the `TAP version 14` line.\n */\n omitVersion?: boolean\n /**\n * Do not elide empty lines and other unnecessary whitespace\n */\n preserveWhitespace?: boolean\n /**\n * Skip this test entirely, emitting a `# SKIP` directive\n */\n skip?: boolean | string\n /**\n * Mark this test as to be done later, emitting a `# TODO` directive\n */\n todo?: boolean | string\n /**\n * Amount of time in milliseconds before this test times out\n */\n timeout?: MILLISECONDS\n\n /**\n * track passes in the results lists, default false\n */\n passes?: boolean\n\n /**\n * treat todo tests as failures, default false\n */\n failTodo?: boolean\n\n /**\n * treat skip tests as failures, default false\n */\n failSkip?: boolean\n\n /**\n * The amount of time that this test took to complete.\n *\n * Typically, this is not set explicitly, but inferred from the actual\n * time spent. However in some cases, it may be reported by the\n * top-level `# time=...` comment in a TAP subprocess stream.\n */\n time?: number\n /**\n * The TAP data from a buffered test.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n tapChildBuffer?: string\n /**\n * The stack where this test was initiated\n */\n stack?: string\n\n /**\n * Parent test of this test\n */\n parent?: Base | TestBase\n /**\n * The name of this test\n */\n name?: string\n /**\n * Numeric identifier attached to child tests. Most of the time, this is\n * set based on the `TAP_CHILD_ID` environment variable.\n */\n childId?: number\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n *\n * If not set in the options, this is initialized to a null-prototyped\n * object, so that usage like `t.context.foo = 'bar'` will work as expected.\n *\n * This is initialized and set on the Test object in the `runMain` method,\n * *not* at construction time. If set explicitly on the Test object in a\n * `before` hook, then any context specified on options or inherited from\n * the parent test will be ignored.\n */\n context?: any\n /**\n * Number of spaces that this test is indented.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n indent?: string\n /**\n * True to output LOTS AND LOTS of noisy debugging information.\n * Set at the top level by the `TAP_DEBUG` environment variable.\n */\n debug?: boolean\n /**\n * Parser to use for this TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n parser?: Parser\n /**\n * True if this test should be buffered, and only processed once\n * complete.\n *\n * Defaults to true when `t.jobs` is set to a value greater than 1.\n *\n * If set false in that case, then the test will NOT be run in parallel,\n * so this provides a way to control the parallelism within a test suite.\n */\n buffered?: boolean\n\n /**\n * Setting silent:true in a subtest option makes it completely excluded\n * from test output, UNLESS it fails.\n *\n * This was used historically for a few things which are now implemented\n * with a more sophisticated promise management system, but can be handy in\n * some rare situations.\n */\n silent?: boolean\n}\n\nexport class Base<\n Events extends TapBaseEvents = TapBaseEvents\n> extends Minipass {\n /**\n * Set upon test completion when a child test is ready to be processed by its\n * parent.\n */\n readyToProcess: boolean = false\n /**\n * Options provided to this test\n */\n options: BaseOpts\n /**\n * number of spaces to indent the TAP stream\n */\n indent: string\n /**\n * TapWrap AsyncResource that limits the async-hook-domain\n *\n * @group Internal Machinery\n */\n hook: TapWrap\n // this actually is deterministically set in the ctor, but\n // in the hook, so tsc doesn't see it.\n /**\n * the async-hook-domain that catches throws and Promise rejections\n *\n * @group Internal Machinery\n */\n hookDomain!: Domain\n /**\n * The timer that fires when the test times out\n *\n * @group Internal Machinery\n */\n timer?: NodeJS.Timeout\n\n /**\n * Set to true when the test times out, so its failure status can be\n * determined later.\n */\n timedOut: boolean = false\n /**\n * The tap parser attached to this TAP stream\n *\n * @group Internal Machinery\n */\n parser: Parser\n /**\n * Method that writes to stderr when `debug: true` is set in the options,\n * or no-ops otherwise\n */\n debug: (...args: any[]) => void\n /**\n * The count of all assertions that this stream emitted\n *\n * @group Test Reflection\n */\n counts: Counts\n /**\n * Lists of todo, skip, and failure test points. If `passes: true` is\n * set in the options, then passing test points will also be tracked.\n *\n * @group Test Reflection\n */\n lists: Lists\n /**\n * the name of this test\n *\n * @group Test Reflection\n */\n name: string\n /**\n * Set on completion. The results of the test run.\n *\n * @group Test Reflection\n */\n results?: FinalResults\n /**\n * Parent test of this TAP stream\n *\n * @group Internal Machinery\n */\n parent?: Base | TestBase\n\n /**\n * Nesting level, for serialization to node test runner\n *\n * Note that this is zero for parent-less tests, and *also* zero\n * for the first level of children.\n */\n nestingLevel: number = 0\n\n /**\n * Bail out on the first failed test point\n */\n bail: boolean\n /**\n * Treat non-TAP data as an error.\n * May be set with `pragma +strict` in the TAP stream, or unset with\n * `pragma: -strict`.\n */\n strict: boolean\n /**\n * Do not emit the `TAP version 14` line at the start\n */\n omitVersion: boolean\n /**\n * Do not elide extraneous whitespace and empty lines.\n */\n preserveWhitespace: boolean\n\n /**\n * Unrecoverable TAP protocol errors in the stream\n *\n * @group Test Reflection\n */\n errors: TapError[]\n\n /**\n * Numeric identifier for this test\n */\n childId: number\n\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n */\n #context: any = unsetContext\n get context () {\n if (this.#context === unsetContext) this.#context = Object.create(null)\n return this.#context\n }\n set context (c: any) {\n this.#context = c\n }\n\n /**\n * the TAP stream data for buffered tests\n *\n * @internal\n *\n * @group Internal Machinery\n */\n output: string\n\n /**\n * True if this test should be buffered and only processed on completion\n *\n * @internal\n *\n * @group Internal Machinery\n */\n buffered: boolean\n\n /**\n * True if this test emitted a bailout\n *\n * @group Test Reflection\n */\n bailedOut: string | boolean\n\n /**\n * high resolution bigint time when this test started\n *\n * @group Internal Machinery\n */\n start: bigint\n #started: boolean = false\n\n /**\n * Amount of time in milliseconds that this test took to complete.\n *\n * @group Test Reflection\n */\n time: MILLISECONDS\n\n /**\n * High resolution time in ns that this test took to complete.\n *\n * @group Test Reflection\n */\n hrtime: bigint\n\n /**\n * True if this test should be buffered and only emit data if it fails\n */\n silent: boolean\n\n /**\n * A `Deferred` promise wrapper that is resolved when this test completes.\n *\n * @group Internal Machinery\n */\n deferred?: Deferred\n\n #printedOutput: boolean = false\n\n #writable: boolean = true\n\n constructor(options: BaseOpts = {}) {\n super({ encoding: 'utf8' })\n // always use the constructor name as toStringTag, so we get\n // [object Test] or [object TAP] and the appropriate typeName\n // in stack traces.\n Object.defineProperty(this, Symbol.toStringTag, {\n value: this.constructor.name,\n configurable: true,\n })\n // all tap streams are sync string minipasses\n this.hook = new TapWrap(this)\n this.options = options\n this.counts = new Counts()\n this.lists = new Lists()\n\n this.silent = !!options.silent\n\n this.bail = !!options.bail\n this.strict = !!options.strict\n this.omitVersion = !!options.omitVersion\n this.preserveWhitespace = options.preserveWhitespace !== false\n this.buffered = this.silent\n ? options.buffered === undefined\n : !!options.buffered\n this.bailedOut = false\n this.errors = []\n this.parent = options.parent\n if (this.parent?.parent) {\n this.nestingLevel = this.parent.nestingLevel + 1\n }\n\n this.time = 0\n this.hrtime = 0n\n this.start = 0n\n this.childId = options.childId || 0\n // do we need this? couldn't we just call the Minipass\n this.output = ''\n this.indent = options.indent || ''\n this.name = options.name || '(unnamed test)'\n this.hook.runInAsyncScope(() => {\n this.hookDomain = new Domain((er, type) => {\n /* c8 ignore start */\n if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n /* c8 ignore stop */\n ;(er as { tapCaught?: string }).tapCaught = type\n this.threw(er)\n })\n })\n this.debug = !!options.debug ? debug(this.name) : () => {}\n\n this.parser =\n options.parser ||\n new Parser({\n bail: this.bail,\n strict: this.strict,\n omitVersion: this.omitVersion,\n preserveWhitespace: this.preserveWhitespace,\n passes: this.options.passes,\n name: this.name,\n })\n this.#setupParser()\n\n // ensure that a skip or todo on a child class reverts\n // back to Base's no-op main.\n if (options.skip || options.todo) {\n this.main = Base.prototype.main\n }\n }\n\n #isFilterSkip(res: Result) {\n return (\n typeof res.skip === 'string' &&\n /^filter: (only|\\/.*\\/)$/.test(res.skip)\n )\n }\n\n #onParserResult(res: Result) {\n this.counts.total++\n const type = res.todo\n ? 'todo'\n : res.skip\n ? 'skip'\n : !res.ok\n ? 'fail'\n : 'pass'\n this.counts[type]++\n if (type === 'pass' && this.options.passes) {\n this.lists.pass.push(res)\n } else if (type === 'todo') {\n this.lists.todo.push(res)\n } else if (type === 'skip') {\n if (!this.#isFilterSkip(res)) this.lists.skip.push(res)\n } else if (type === 'fail') {\n this.lists.fail.push(res)\n }\n }\n\n #setupParser() {\n this.parser.on('line', l => this.#online(l))\n this.parser.once('bailout', reason => this.onbail(reason))\n this.parser.on('complete', result => this.oncomplete(result))\n this.parser.on('result', res => this.#onParserResult(res))\n }\n\n /**\n * Set the amount of time in milliseconds before this test is considered\n * a timeout. The time is counted from right now, so for example, repeatedly\n * calling `t.setTimeout(100)` can keep it going indefinitely, as long as\n * you call it more often than every 100ms.\n *\n * Calling `setTimeout(0)` will remove the timer and allow the test to run\n * indefinitely.\n *\n * @group Test Lifecycle Management\n */\n setTimeout(n: MILLISECONDS) {\n if (this.timer) {\n clearTimeout(this.timer)\n }\n if (n <= 0) {\n this.timer = undefined\n delete this.options.timeout\n } else {\n this.options.timeout = n\n this.timer = setTimeout(() => this.timeout(), n)\n /* c8 ignore start */\n if (this.timer.unref) this.timer.unref()\n /* c8 ignore stop */\n }\n }\n\n /**\n * Called when a timeout occurs. Only exposed because it has to be called\n * and/or extended by other classes, which all have their own sorts of\n * timeout behavior specific to the type of thing they represent.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n timeout(\n options: { expired?: string; message?: string } = {\n expired: this.name,\n message: 'timeout!',\n }\n ) {\n this.timedOut = true\n const { message = 'timeout!' } = options\n this.setTimeout(0)\n options.expired = options.expired || this.name\n // timeouts don't generally have a useful callsite information,\n // and no sense trying to capture it from @tapjs/stack\n const extra: Extra = {\n ...options,\n message,\n stack: '',\n at: {},\n }\n\n const threw = this.threw({ message }, extra)\n delete extra.stack\n delete extra.at\n if (threw) {\n this.emit('timeout', threw)\n }\n }\n\n /**\n * Run the `main` test function. Called by\n * {@link @tapjs/core!test-base.TestBase} when starting a subtest.\n * Initializes the TapWrap hook\n *\n * @internal\n *\n * @group Internal Machinery\n */\n runMain(cb: () => void) {\n this.debug('BASE runMain')\n this.start = hrtime.bigint()\n this.#started = true\n\n // if it's null or an object, inherit from it. otherwise, copy it.\n const ctx =\n this.#context !== unsetContext ? this.#context :\n ('context' in this.options\n ? this.options.context\n : this.parent?.context) ??\n null\n this.#context = typeof ctx === 'object' ? Object.create(ctx) : ctx\n\n this.hook.runInAsyncScope(this.main, this, cb)\n }\n\n /**\n * Returns true if this test has begun\n *\n * @group Test Reflection\n */\n get started() {\n return this.#started\n }\n\n /**\n * True if the test has printed *some* output of any kind\n *\n * @group Test Reflection\n */\n get printedOutput() {\n return this.#printedOutput\n }\n\n /**\n * Boolean indicating whether the underlying stream can be written to,\n * or if it has been ended.\n */\n get streamWritable() {\n return this.#writable\n }\n\n /**\n * The main test function. For this Base class, this is a no-op. Subclasses\n * implement this in their specific ways.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n main(cb: () => void) {\n cb()\n }\n\n /**\n * Stream write method.\n *\n * For buffered tests, this collects the output in the\n * {@link @tapjs/core!base.Base#output}\n * field. Sets {@link @tapjs/core!base.Base#printedOutput} to `true` when\n * called.\n *\n * Note: you *probably* never need to call this. Instead, use the various\n * assertion methods and other parts of the API.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n write(c: string) {\n this.#printedOutput = true\n if (this.buffered || this.silent) {\n // need the silent output if it fails\n this.output += c\n return true\n }\n\n if (!this.#writable) {\n return false\n }\n\n return super.write(c)\n }\n\n /**\n * Method called when the parser encounters a bail out\n *\n * Extended by {@link @tapjs/core!test-base.TestBase}\n */\n onbail(reason?: string) {\n this.bailedOut = reason || true\n this.emit('bailout', reason)\n }\n\n /**\n * Method called when parser emits a line of TAP data\n *\n * @internal\n *\n * @group Internal Machinery\n */\n #online(line: string) {\n this.debug('LINE %j', line, [this.name, this.indent])\n return this.write(this.indent + line)\n }\n\n /**\n * Method called when the parser completes and emits its final results\n *\n * Extended by {@link @tapjs/core!worker.Worker} and\n * {@link @tapjs/core!tap.TAP} classes\n *\n * @internal\n *\n * @group Internal Machinery\n */\n oncomplete(results: FinalResults) {\n if (this.start) {\n this.hrtime = hrtime.bigint() - this.start\n this.time =\n results.time || Math.floor(Number(this.hrtime) / 1000) / 1000\n }\n\n this.debug('ONCOMPLETE %j %j', this.name, results)\n\n // should only ever happen once, but just in case\n /* c8 ignore start */\n if (this.results) {\n Object.assign(results, this.results)\n }\n /* c8 ignore stop */\n\n this.results = results\n this.emit('complete', results)\n const errors = results.failures\n .filter(f => f.tapError)\n .map(f => {\n delete f.diag\n delete f.ok\n return f\n })\n\n if (errors.length) {\n this.errors = errors\n }\n\n this.#writable = false\n super.end()\n }\n\n /**\n * extension point for plugins that want to be notified when the test\n * is about to end, whether explicitly or implicitly.\n *\n * If the function returns a Promise, it will be awaited before ending\n * the TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onbeforeend(): Promise | void {}\n\n /**\n * extension point for plugins that want to be notified when the test\n * is completely done, and terminating its parser.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onEOF(): Promise | void {}\n\n /**\n * extension point for TestBase to know when a child tests is done being\n * processed and it's safe to move on to the next one.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n ondone() {}\n\n /**\n * EventEmitter emit method, but closes the\n * {@link @tapjs/core!base.Base#hook} and\n * {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n emit(\n ev: Event,\n ...data: Events[Event]\n ) {\n const ret = super.emit(ev, ...data)\n if (ev === 'end') {\n this.ondone()\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n }\n return ret\n }\n\n /**\n * Mark the test as ended. In this base class, this is a no-op, but\n * in {@link @tapjs/core!test-base.TestBase}, it also triggers the other\n * end-of-test operations.\n */\n end() {\n return this\n }\n\n /**\n * Method called when an unrecoverable error is encountered in a test.\n *\n * Typically, in tests you would not call this, you'd just actually throw\n * an error.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n threw(\n er: any,\n extra?: Extra,\n proxy: boolean = false,\n ended: boolean = false\n ): Extra | void | undefined {\n this.debug('BASE.threw', er)\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n if (typeof er === 'string') {\n er = { message: er }\n } else if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n if (this.name && !proxy) {\n er.test = this.name\n }\n\n const message = messageFromError(er)\n if (!extra) {\n extra = extraFromError(er, extra)\n }\n extra.message = message\n\n this.parser.ok = false\n\n // if possible to handle it here, then return the info so that this\n // Base subclass can do its thing\n if (\n !ended &&\n !this.results &&\n /* c8 ignore start */\n (this.parser.planEnd === -1 ||\n this.parser.count < this.parser.planEnd)\n /* c8 ignore stop */\n ) {\n return extra\n }\n\n // if we ended, we have to report it SOMEWHERE, unless we're\n // already in the process of bailing out, in which case it's\n // a bit excessive. Do not print it here if it would trigger\n // a plan exceeded error, or if we already have results.\n this.debug(\n 'Base.threw, but finished',\n this.name,\n this.results,\n extra.message\n )\n const alreadyBailing =\n (this.results?.ok === false && this.bail) ||\n this.parser.bailedOut ||\n this.results?.bailout\n if (this.results) this.results.ok = false\n if (this.parent) {\n this.parent.threw(er, extra, true)\n } else if (!alreadyBailing) {\n // not already bailing out, so print the error as best we can\n if (!er.stack) {\n console.error(er)\n } else {\n /* c8 ignore start */\n const name = er.name || 'Error'\n /* c8 ignore stop */\n console.error('%s: %s', name, extra.message)\n console.error(diags(extra))\n }\n }\n // we are already bailing out, and this is the top level,\n // just make our way hastily to the nearest exit.\n }\n\n /**\n * returns true if the test has not as yet encountered any failures\n *\n * @group Test Reflection\n */\n passing() {\n return this.parser.ok && this.results?.ok !== false\n }\n}\n"]} \ No newline at end of file diff --git a/src/core/dist/esm/base.d.ts b/src/core/dist/esm/base.d.ts index 80fe5c586..5196c096f 100644 --- a/src/core/dist/esm/base.d.ts +++ b/src/core/dist/esm/base.d.ts @@ -295,13 +295,8 @@ export declare class Base extends * Numeric identifier for this test */ childId: number; - /** - * Any arbitrary data that is provided to this test object. Often, this - * is set in a `t.before()` or `t.beforeEach()` method. Scalar values - * are inherited by child tests. Object values are extended in child - * tests using `Object.create()`. - */ - context: any; + get context(): any; + set context(c: any); /** * the TAP stream data for buffered tests * diff --git a/src/core/dist/esm/base.d.ts.map b/src/core/dist/esm/base.d.ts.map index 5943feecc..03fc9b2a7 100644 --- a/src/core/dist/esm/base.d.ts.map +++ b/src/core/dist/esm/base.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,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;;;;;;;;OAUG;IACH,UAAU,CAAC,CAAC,EAAE,YAAY;IAgB1B;;;;;;;;OAQG;IACH,OAAO,CACL,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAG5C;IAuBH;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI;IAiBtB;;;;OAIG;IACH,IAAI,OAAO,YAEV;IAED;;;;OAIG;IACH,IAAI,aAAa,YAEhB;IAED;;;OAGG;IACH,IAAI,cAAc,YAEjB;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,EAAE,MAAM,IAAI;IAInB;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM;IAef;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM;IAiBtB;;;;;;;;;OASG;IACH,UAAU,CAAC,OAAO,EAAE,YAAY;IAkChC;;;;;;;;;;OAUG;IACH,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAEnC;;;;;;;OAOG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAE7B;;;;;;;OAOG;IACH,MAAM;IAEN;;;;;;;;OAQG;IACH,IAAI,CAAC,KAAK,SAAS,MAAM,MAAM,EAC7B,EAAE,EAAE,KAAK,EACT,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC;IAWxB;;;;OAIG;IACH,GAAG;IAIH;;;;;;;;;OASG;IACH,KAAK,CACH,EAAE,EAAE,GAAG,EACP,KAAK,CAAC,EAAE,KAAK,EACb,KAAK,GAAE,OAAe,EACtB,KAAK,GAAE,OAAe,GACrB,KAAK,GAAG,IAAI,GAAG,SAAS;IAmE3B;;;;OAIG;IACH,OAAO;CAGR"} \ No newline at end of file +{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;A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;;;OAIG;IACH,OAAO;CAGR"} \ No newline at end of file diff --git a/src/core/dist/esm/base.js b/src/core/dist/esm/base.js index 28fa8194a..15ef9e8e5 100644 --- a/src/core/dist/esm/base.js +++ b/src/core/dist/esm/base.js @@ -14,6 +14,7 @@ import { diags } from './diags.js'; import { extraFromError } from './extra-from-error.js'; import { Lists } from './lists.js'; import { messageFromError } from './message-from-error.js'; +const unsetContext = Symbol('TAP.context unset'); /** * Wrapper for the async-hook-domain that catches errors thrown during * test operation. @@ -160,7 +161,15 @@ export class Base extends Minipass { * are inherited by child tests. Object values are extended in child * tests using `Object.create()`. */ - context; + #context = unsetContext; + get context() { + if (this.#context === unsetContext) + this.#context = Object.create(null); + return this.#context; + } + set context(c) { + this.#context = c; + } /** * the TAP stream data for buffered tests * @@ -388,12 +397,12 @@ export class Base extends Minipass { this.start = hrtime.bigint(); this.#started = true; // if it's null or an object, inherit from it. otherwise, copy it. - const ctx = this.context ?? + const ctx = this.#context !== unsetContext ? this.#context : ('context' in this.options ? this.options.context : this.parent?.context) ?? - null; - this.context = typeof ctx === 'object' ? Object.create(ctx) : ctx; + null; + this.#context = typeof ctx === 'object' ? Object.create(ctx) : ctx; this.hook.runInAsyncScope(this.main, this, cb); } /** diff --git a/src/core/dist/esm/base.js.map b/src/core/dist/esm/base.js.map index 9619a54d7..4f362a00f 100644 --- a/src/core/dist/esm/base.js.map +++ b/src/core/dist/esm/base.js.map @@ -1 +1 @@ -{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAA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O,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,CAAA;IACrD,CAAC;CACF","sourcesContent":["/**\n * The base class that is extended by all TAP-generating classes\n *\n * @module\n */\n\nimport { Domain } from 'async-hook-domain'\nimport { AsyncResource } from 'async_hooks'\nimport { Minipass } from 'minipass'\nimport { hrtime } from 'node:process'\nimport { format } from 'node:util'\nimport { FinalResults, Parser, Result, TapError } from 'tap-parser'\nimport { Deferred } from 'trivial-deferred'\nimport { Counts } from './counts.js'\nimport { diags } from './diags.js'\nimport { extraFromError } from './extra-from-error.js'\nimport type { Extra, TestBase } from './index.js'\nimport { Lists } from './lists.js'\nimport { messageFromError } from './message-from-error.js'\n\n/**\n * Events emitted by the Base class\n */\nexport interface TapBaseEvents extends Minipass.Events {\n /**\n * emitted when a timeout occurs\n */\n timeout: [threw?: Extra]\n /**\n * emitted when the test bails out\n */\n bailout: [reason?: string]\n /**\n * emitted when the test is complete\n */\n complete: [results: FinalResults]\n}\n\n/**\n * Wrapper for the async-hook-domain that catches errors thrown during\n * test operation.\n *\n * @see {@link https://npmjs.com/async-hook-domain}\n */\nexport class TapWrap extends AsyncResource {\n test: Base\n onDestroy?: () => void\n constructor(test: Base) {\n super(`tap.${test.constructor.name}`)\n this.test = test\n }\n emitDestroy() {\n this.onDestroy?.()\n super.emitDestroy()\n return this\n }\n}\n\nconst debug =\n (name: string) =>\n (...args: any[]) => {\n const prefix = `TAP ${process.pid} ${name}: `\n const msg = format(...args).trim()\n console.error(prefix + msg.split('\\n').join(`\\n${prefix}`))\n }\n\n/**\n * A number indicating an amount of milliseconds\n */\nexport type MILLISECONDS = number\n\n/**\n * Options that may be passed to any TAP-generating class\n */\nexport interface BaseOpts extends Extra {\n /**\n * Bail out on the first failure\n */\n bail?: boolean\n /**\n * Treat any unknown non-TAP data as an error\n * May be set at run-time by the TAP stream using `pragma +strict`\n */\n strict?: boolean\n /**\n * Do not emit the `TAP version 14` line.\n */\n omitVersion?: boolean\n /**\n * Do not elide empty lines and other unnecessary whitespace\n */\n preserveWhitespace?: boolean\n /**\n * Skip this test entirely, emitting a `# SKIP` directive\n */\n skip?: boolean | string\n /**\n * Mark this test as to be done later, emitting a `# TODO` directive\n */\n todo?: boolean | string\n /**\n * Amount of time in milliseconds before this test times out\n */\n timeout?: MILLISECONDS\n\n /**\n * track passes in the results lists, default false\n */\n passes?: boolean\n\n /**\n * treat todo tests as failures, default false\n */\n failTodo?: boolean\n\n /**\n * treat skip tests as failures, default false\n */\n failSkip?: boolean\n\n /**\n * The amount of time that this test took to complete.\n *\n * Typically, this is not set explicitly, but inferred from the actual\n * time spent. However in some cases, it may be reported by the\n * top-level `# time=...` comment in a TAP subprocess stream.\n */\n time?: number\n /**\n * The TAP data from a buffered test.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n tapChildBuffer?: string\n /**\n * The stack where this test was initiated\n */\n stack?: string\n\n /**\n * Parent test of this test\n */\n parent?: Base | TestBase\n /**\n * The name of this test\n */\n name?: string\n /**\n * Numeric identifier attached to child tests. Most of the time, this is\n * set based on the `TAP_CHILD_ID` environment variable.\n */\n childId?: number\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n *\n * If not set in the options, this is initialized to a null-prototyped\n * object, so that usage like `t.context.foo = 'bar'` will work as expected.\n *\n * This is initialized and set on the Test object in the `runMain` method,\n * *not* at construction time. If set explicitly on the Test object in a\n * `before` hook, then any context specified on options or inherited from\n * the parent test will be ignored.\n */\n context?: any\n /**\n * Number of spaces that this test is indented.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n indent?: string\n /**\n * True to output LOTS AND LOTS of noisy debugging information.\n * Set at the top level by the `TAP_DEBUG` environment variable.\n */\n debug?: boolean\n /**\n * Parser to use for this TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n parser?: Parser\n /**\n * True if this test should be buffered, and only processed once\n * complete.\n *\n * Defaults to true when `t.jobs` is set to a value greater than 1.\n *\n * If set false in that case, then the test will NOT be run in parallel,\n * so this provides a way to control the parallelism within a test suite.\n */\n buffered?: boolean\n\n /**\n * Setting silent:true in a subtest option makes it completely excluded\n * from test output, UNLESS it fails.\n *\n * This was used historically for a few things which are now implemented\n * with a more sophisticated promise management system, but can be handy in\n * some rare situations.\n */\n silent?: boolean\n}\n\nexport class Base<\n Events extends TapBaseEvents = TapBaseEvents\n> extends Minipass {\n /**\n * Set upon test completion when a child test is ready to be processed by its\n * parent.\n */\n readyToProcess: boolean = false\n /**\n * Options provided to this test\n */\n options: BaseOpts\n /**\n * number of spaces to indent the TAP stream\n */\n indent: string\n /**\n * TapWrap AsyncResource that limits the async-hook-domain\n *\n * @group Internal Machinery\n */\n hook: TapWrap\n // this actually is deterministically set in the ctor, but\n // in the hook, so tsc doesn't see it.\n /**\n * the async-hook-domain that catches throws and Promise rejections\n *\n * @group Internal Machinery\n */\n hookDomain!: Domain\n /**\n * The timer that fires when the test times out\n *\n * @group Internal Machinery\n */\n timer?: NodeJS.Timeout\n\n /**\n * Set to true when the test times out, so its failure status can be\n * determined later.\n */\n timedOut: boolean = false\n /**\n * The tap parser attached to this TAP stream\n *\n * @group Internal Machinery\n */\n parser: Parser\n /**\n * Method that writes to stderr when `debug: true` is set in the options,\n * or no-ops otherwise\n */\n debug: (...args: any[]) => void\n /**\n * The count of all assertions that this stream emitted\n *\n * @group Test Reflection\n */\n counts: Counts\n /**\n * Lists of todo, skip, and failure test points. If `passes: true` is\n * set in the options, then passing test points will also be tracked.\n *\n * @group Test Reflection\n */\n lists: Lists\n /**\n * the name of this test\n *\n * @group Test Reflection\n */\n name: string\n /**\n * Set on completion. The results of the test run.\n *\n * @group Test Reflection\n */\n results?: FinalResults\n /**\n * Parent test of this TAP stream\n *\n * @group Internal Machinery\n */\n parent?: Base | TestBase\n\n /**\n * Nesting level, for serialization to node test runner\n *\n * Note that this is zero for parent-less tests, and *also* zero\n * for the first level of children.\n */\n nestingLevel: number = 0\n\n /**\n * Bail out on the first failed test point\n */\n bail: boolean\n /**\n * Treat non-TAP data as an error.\n * May be set with `pragma +strict` in the TAP stream, or unset with\n * `pragma: -strict`.\n */\n strict: boolean\n /**\n * Do not emit the `TAP version 14` line at the start\n */\n omitVersion: boolean\n /**\n * Do not elide extraneous whitespace and empty lines.\n */\n preserveWhitespace: boolean\n\n /**\n * Unrecoverable TAP protocol errors in the stream\n *\n * @group Test Reflection\n */\n errors: TapError[]\n\n /**\n * Numeric identifier for this test\n */\n childId: number\n\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n */\n context: any\n\n /**\n * the TAP stream data for buffered tests\n *\n * @internal\n *\n * @group Internal Machinery\n */\n output: string\n\n /**\n * True if this test should be buffered and only processed on completion\n *\n * @internal\n *\n * @group Internal Machinery\n */\n buffered: boolean\n\n /**\n * True if this test emitted a bailout\n *\n * @group Test Reflection\n */\n bailedOut: string | boolean\n\n /**\n * high resolution bigint time when this test started\n *\n * @group Internal Machinery\n */\n start: bigint\n #started: boolean = false\n\n /**\n * Amount of time in milliseconds that this test took to complete.\n *\n * @group Test Reflection\n */\n time: MILLISECONDS\n\n /**\n * High resolution time in ns that this test took to complete.\n *\n * @group Test Reflection\n */\n hrtime: bigint\n\n /**\n * True if this test should be buffered and only emit data if it fails\n */\n silent: boolean\n\n /**\n * A `Deferred` promise wrapper that is resolved when this test completes.\n *\n * @group Internal Machinery\n */\n deferred?: Deferred\n\n #printedOutput: boolean = false\n\n #writable: boolean = true\n\n constructor(options: BaseOpts = {}) {\n super({ encoding: 'utf8' })\n // always use the constructor name as toStringTag, so we get\n // [object Test] or [object TAP] and the appropriate typeName\n // in stack traces.\n Object.defineProperty(this, Symbol.toStringTag, {\n value: this.constructor.name,\n configurable: true,\n })\n // all tap streams are sync string minipasses\n this.hook = new TapWrap(this)\n this.options = options\n this.counts = new Counts()\n this.lists = new Lists()\n\n this.silent = !!options.silent\n\n this.bail = !!options.bail\n this.strict = !!options.strict\n this.omitVersion = !!options.omitVersion\n this.preserveWhitespace = options.preserveWhitespace !== false\n this.buffered = this.silent\n ? options.buffered === undefined\n : !!options.buffered\n this.bailedOut = false\n this.errors = []\n this.parent = options.parent\n if (this.parent?.parent) {\n this.nestingLevel = this.parent.nestingLevel + 1\n }\n\n this.time = 0\n this.hrtime = 0n\n this.start = 0n\n this.childId = options.childId || 0\n // do we need this? couldn't we just call the Minipass\n this.output = ''\n this.indent = options.indent || ''\n this.name = options.name || '(unnamed test)'\n this.hook.runInAsyncScope(() => {\n this.hookDomain = new Domain((er, type) => {\n /* c8 ignore start */\n if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n /* c8 ignore stop */\n ;(er as { tapCaught?: string }).tapCaught = type\n this.threw(er)\n })\n })\n this.debug = !!options.debug ? debug(this.name) : () => {}\n\n this.parser =\n options.parser ||\n new Parser({\n bail: this.bail,\n strict: this.strict,\n omitVersion: this.omitVersion,\n preserveWhitespace: this.preserveWhitespace,\n passes: this.options.passes,\n name: this.name,\n })\n this.#setupParser()\n\n // ensure that a skip or todo on a child class reverts\n // back to Base's no-op main.\n if (options.skip || options.todo) {\n this.main = Base.prototype.main\n }\n }\n\n #isFilterSkip(res: Result) {\n return (\n typeof res.skip === 'string' &&\n /^filter: (only|\\/.*\\/)$/.test(res.skip)\n )\n }\n\n #onParserResult(res: Result) {\n this.counts.total++\n const type = res.todo\n ? 'todo'\n : res.skip\n ? 'skip'\n : !res.ok\n ? 'fail'\n : 'pass'\n this.counts[type]++\n if (type === 'pass' && this.options.passes) {\n this.lists.pass.push(res)\n } else if (type === 'todo') {\n this.lists.todo.push(res)\n } else if (type === 'skip') {\n if (!this.#isFilterSkip(res)) this.lists.skip.push(res)\n } else if (type === 'fail') {\n this.lists.fail.push(res)\n }\n }\n\n #setupParser() {\n this.parser.on('line', l => this.#online(l))\n this.parser.once('bailout', reason => this.onbail(reason))\n this.parser.on('complete', result => this.oncomplete(result))\n this.parser.on('result', res => this.#onParserResult(res))\n }\n\n /**\n * Set the amount of time in milliseconds before this test is considered\n * a timeout. The time is counted from right now, so for example, repeatedly\n * calling `t.setTimeout(100)` can keep it going indefinitely, as long as\n * you call it more often than every 100ms.\n *\n * Calling `setTimeout(0)` will remove the timer and allow the test to run\n * indefinitely.\n *\n * @group Test Lifecycle Management\n */\n setTimeout(n: MILLISECONDS) {\n if (this.timer) {\n clearTimeout(this.timer)\n }\n if (n <= 0) {\n this.timer = undefined\n delete this.options.timeout\n } else {\n this.options.timeout = n\n this.timer = setTimeout(() => this.timeout(), n)\n /* c8 ignore start */\n if (this.timer.unref) this.timer.unref()\n /* c8 ignore stop */\n }\n }\n\n /**\n * Called when a timeout occurs. Only exposed because it has to be called\n * and/or extended by other classes, which all have their own sorts of\n * timeout behavior specific to the type of thing they represent.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n timeout(\n options: { expired?: string; message?: string } = {\n expired: this.name,\n message: 'timeout!',\n }\n ) {\n this.timedOut = true\n const { message = 'timeout!' } = options\n this.setTimeout(0)\n options.expired = options.expired || this.name\n // timeouts don't generally have a useful callsite information,\n // and no sense trying to capture it from @tapjs/stack\n const extra: Extra = {\n ...options,\n message,\n stack: '',\n at: {},\n }\n\n const threw = this.threw({ message }, extra)\n delete extra.stack\n delete extra.at\n if (threw) {\n this.emit('timeout', threw)\n }\n }\n\n /**\n * Run the `main` test function. Called by\n * {@link @tapjs/core!test-base.TestBase} when starting a subtest.\n * Initializes the TapWrap hook\n *\n * @internal\n *\n * @group Internal Machinery\n */\n runMain(cb: () => void) {\n this.debug('BASE runMain')\n this.start = hrtime.bigint()\n this.#started = true\n\n // if it's null or an object, inherit from it. otherwise, copy it.\n const ctx =\n this.context ??\n ('context' in this.options\n ? this.options.context\n : this.parent?.context) ??\n null\n this.context = typeof ctx === 'object' ? Object.create(ctx) : ctx\n\n this.hook.runInAsyncScope(this.main, this, cb)\n }\n\n /**\n * Returns true if this test has begun\n *\n * @group Test Reflection\n */\n get started() {\n return this.#started\n }\n\n /**\n * True if the test has printed *some* output of any kind\n *\n * @group Test Reflection\n */\n get printedOutput() {\n return this.#printedOutput\n }\n\n /**\n * Boolean indicating whether the underlying stream can be written to,\n * or if it has been ended.\n */\n get streamWritable() {\n return this.#writable\n }\n\n /**\n * The main test function. For this Base class, this is a no-op. Subclasses\n * implement this in their specific ways.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n main(cb: () => void) {\n cb()\n }\n\n /**\n * Stream write method.\n *\n * For buffered tests, this collects the output in the\n * {@link @tapjs/core!base.Base#output}\n * field. Sets {@link @tapjs/core!base.Base#printedOutput} to `true` when\n * called.\n *\n * Note: you *probably* never need to call this. Instead, use the various\n * assertion methods and other parts of the API.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n write(c: string) {\n this.#printedOutput = true\n if (this.buffered || this.silent) {\n // need the silent output if it fails\n this.output += c\n return true\n }\n\n if (!this.#writable) {\n return false\n }\n\n return super.write(c)\n }\n\n /**\n * Method called when the parser encounters a bail out\n *\n * Extended by {@link @tapjs/core!test-base.TestBase}\n */\n onbail(reason?: string) {\n this.bailedOut = reason || true\n this.emit('bailout', reason)\n }\n\n /**\n * Method called when parser emits a line of TAP data\n *\n * @internal\n *\n * @group Internal Machinery\n */\n #online(line: string) {\n this.debug('LINE %j', line, [this.name, this.indent])\n return this.write(this.indent + line)\n }\n\n /**\n * Method called when the parser completes and emits its final results\n *\n * Extended by {@link @tapjs/core!worker.Worker} and\n * {@link @tapjs/core!tap.TAP} classes\n *\n * @internal\n *\n * @group Internal Machinery\n */\n oncomplete(results: FinalResults) {\n if (this.start) {\n this.hrtime = hrtime.bigint() - this.start\n this.time =\n results.time || Math.floor(Number(this.hrtime) / 1000) / 1000\n }\n\n this.debug('ONCOMPLETE %j %j', this.name, results)\n\n // should only ever happen once, but just in case\n /* c8 ignore start */\n if (this.results) {\n Object.assign(results, this.results)\n }\n /* c8 ignore stop */\n\n this.results = results\n this.emit('complete', results)\n const errors = results.failures\n .filter(f => f.tapError)\n .map(f => {\n delete f.diag\n delete f.ok\n return f\n })\n\n if (errors.length) {\n this.errors = errors\n }\n\n this.#writable = false\n super.end()\n }\n\n /**\n * extension point for plugins that want to be notified when the test\n * is about to end, whether explicitly or implicitly.\n *\n * If the function returns a Promise, it will be awaited before ending\n * the TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onbeforeend(): Promise | void {}\n\n /**\n * extension point for plugins that want to be notified when the test\n * is completely done, and terminating its parser.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onEOF(): Promise | void {}\n\n /**\n * extension point for TestBase to know when a child tests is done being\n * processed and it's safe to move on to the next one.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n ondone() {}\n\n /**\n * EventEmitter emit method, but closes the\n * {@link @tapjs/core!base.Base#hook} and\n * {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n emit(\n ev: Event,\n ...data: Events[Event]\n ) {\n const ret = super.emit(ev, ...data)\n if (ev === 'end') {\n this.ondone()\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n }\n return ret\n }\n\n /**\n * Mark the test as ended. In this base class, this is a no-op, but\n * in {@link @tapjs/core!test-base.TestBase}, it also triggers the other\n * end-of-test operations.\n */\n end() {\n return this\n }\n\n /**\n * Method called when an unrecoverable error is encountered in a test.\n *\n * Typically, in tests you would not call this, you'd just actually throw\n * an error.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n threw(\n er: any,\n extra?: Extra,\n proxy: boolean = false,\n ended: boolean = false\n ): Extra | void | undefined {\n this.debug('BASE.threw', er)\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n if (typeof er === 'string') {\n er = { message: er }\n } else if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n if (this.name && !proxy) {\n er.test = this.name\n }\n\n const message = messageFromError(er)\n if (!extra) {\n extra = extraFromError(er, extra)\n }\n extra.message = message\n\n this.parser.ok = false\n\n // if possible to handle it here, then return the info so that this\n // Base subclass can do its thing\n if (\n !ended &&\n !this.results &&\n /* c8 ignore start */\n (this.parser.planEnd === -1 ||\n this.parser.count < this.parser.planEnd)\n /* c8 ignore stop */\n ) {\n return extra\n }\n\n // if we ended, we have to report it SOMEWHERE, unless we're\n // already in the process of bailing out, in which case it's\n // a bit excessive. Do not print it here if it would trigger\n // a plan exceeded error, or if we already have results.\n this.debug(\n 'Base.threw, but finished',\n this.name,\n this.results,\n extra.message\n )\n const alreadyBailing =\n (this.results?.ok === false && this.bail) ||\n this.parser.bailedOut ||\n this.results?.bailout\n if (this.results) this.results.ok = false\n if (this.parent) {\n this.parent.threw(er, extra, true)\n } else if (!alreadyBailing) {\n // not already bailing out, so print the error as best we can\n if (!er.stack) {\n console.error(er)\n } else {\n /* c8 ignore start */\n const name = er.name || 'Error'\n /* c8 ignore stop */\n console.error('%s: %s', name, extra.message)\n console.error(diags(extra))\n }\n }\n // we are already bailing out, and this is the top level,\n // just make our way hastily to the nearest exit.\n }\n\n /**\n * returns true if the test has not as yet encountered any failures\n *\n * @group Test Reflection\n */\n passing() {\n return this.parser.ok && this.results?.ok !== false\n }\n}\n"]} \ No newline at end of file +{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAgB,MAAM,EAAoB,MAAM,YAAY,CAAA;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;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BACrB,MAAM,IAAI,GAAG,EAAE,CAAC,IAAI,IAAI,OAAO,CAAA;gBAC/B,oBAAoB;gBACpB,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;gBAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;aAC5B;SACF;QACD,yDAAyD;QACzD,iDAAiD;IACnD,CAAC;IAED;;;;OAIG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,KAAK,CAAA;IACrD,CAAC;CACF","sourcesContent":["/**\n * The base class that is extended by all TAP-generating classes\n *\n * @module\n */\n\nimport { Domain } from 'async-hook-domain'\nimport { AsyncResource } from 'async_hooks'\nimport { Minipass } from 'minipass'\nimport { hrtime } from 'node:process'\nimport { format } from 'node:util'\nimport { FinalResults, Parser, Result, TapError } from 'tap-parser'\nimport { Deferred } from 'trivial-deferred'\nimport { Counts } from './counts.js'\nimport { diags } from './diags.js'\nimport { extraFromError } from './extra-from-error.js'\nimport type { Extra, TestBase } from './index.js'\nimport { Lists } from './lists.js'\nimport { messageFromError } from './message-from-error.js'\n\nconst unsetContext = Symbol('TAP.context unset')\n\n/**\n * Events emitted by the Base class\n */\nexport interface TapBaseEvents extends Minipass.Events {\n /**\n * emitted when a timeout occurs\n */\n timeout: [threw?: Extra]\n /**\n * emitted when the test bails out\n */\n bailout: [reason?: string]\n /**\n * emitted when the test is complete\n */\n complete: [results: FinalResults]\n}\n\n/**\n * Wrapper for the async-hook-domain that catches errors thrown during\n * test operation.\n *\n * @see {@link https://npmjs.com/async-hook-domain}\n */\nexport class TapWrap extends AsyncResource {\n test: Base\n onDestroy?: () => void\n constructor(test: Base) {\n super(`tap.${test.constructor.name}`)\n this.test = test\n }\n emitDestroy() {\n this.onDestroy?.()\n super.emitDestroy()\n return this\n }\n}\n\nconst debug =\n (name: string) =>\n (...args: any[]) => {\n const prefix = `TAP ${process.pid} ${name}: `\n const msg = format(...args).trim()\n console.error(prefix + msg.split('\\n').join(`\\n${prefix}`))\n }\n\n/**\n * A number indicating an amount of milliseconds\n */\nexport type MILLISECONDS = number\n\n/**\n * Options that may be passed to any TAP-generating class\n */\nexport interface BaseOpts extends Extra {\n /**\n * Bail out on the first failure\n */\n bail?: boolean\n /**\n * Treat any unknown non-TAP data as an error\n * May be set at run-time by the TAP stream using `pragma +strict`\n */\n strict?: boolean\n /**\n * Do not emit the `TAP version 14` line.\n */\n omitVersion?: boolean\n /**\n * Do not elide empty lines and other unnecessary whitespace\n */\n preserveWhitespace?: boolean\n /**\n * Skip this test entirely, emitting a `# SKIP` directive\n */\n skip?: boolean | string\n /**\n * Mark this test as to be done later, emitting a `# TODO` directive\n */\n todo?: boolean | string\n /**\n * Amount of time in milliseconds before this test times out\n */\n timeout?: MILLISECONDS\n\n /**\n * track passes in the results lists, default false\n */\n passes?: boolean\n\n /**\n * treat todo tests as failures, default false\n */\n failTodo?: boolean\n\n /**\n * treat skip tests as failures, default false\n */\n failSkip?: boolean\n\n /**\n * The amount of time that this test took to complete.\n *\n * Typically, this is not set explicitly, but inferred from the actual\n * time spent. However in some cases, it may be reported by the\n * top-level `# time=...` comment in a TAP subprocess stream.\n */\n time?: number\n /**\n * The TAP data from a buffered test.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n tapChildBuffer?: string\n /**\n * The stack where this test was initiated\n */\n stack?: string\n\n /**\n * Parent test of this test\n */\n parent?: Base | TestBase\n /**\n * The name of this test\n */\n name?: string\n /**\n * Numeric identifier attached to child tests. Most of the time, this is\n * set based on the `TAP_CHILD_ID` environment variable.\n */\n childId?: number\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n *\n * If not set in the options, this is initialized to a null-prototyped\n * object, so that usage like `t.context.foo = 'bar'` will work as expected.\n *\n * This is initialized and set on the Test object in the `runMain` method,\n * *not* at construction time. If set explicitly on the Test object in a\n * `before` hook, then any context specified on options or inherited from\n * the parent test will be ignored.\n */\n context?: any\n /**\n * Number of spaces that this test is indented.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n indent?: string\n /**\n * True to output LOTS AND LOTS of noisy debugging information.\n * Set at the top level by the `TAP_DEBUG` environment variable.\n */\n debug?: boolean\n /**\n * Parser to use for this TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n parser?: Parser\n /**\n * True if this test should be buffered, and only processed once\n * complete.\n *\n * Defaults to true when `t.jobs` is set to a value greater than 1.\n *\n * If set false in that case, then the test will NOT be run in parallel,\n * so this provides a way to control the parallelism within a test suite.\n */\n buffered?: boolean\n\n /**\n * Setting silent:true in a subtest option makes it completely excluded\n * from test output, UNLESS it fails.\n *\n * This was used historically for a few things which are now implemented\n * with a more sophisticated promise management system, but can be handy in\n * some rare situations.\n */\n silent?: boolean\n}\n\nexport class Base<\n Events extends TapBaseEvents = TapBaseEvents\n> extends Minipass {\n /**\n * Set upon test completion when a child test is ready to be processed by its\n * parent.\n */\n readyToProcess: boolean = false\n /**\n * Options provided to this test\n */\n options: BaseOpts\n /**\n * number of spaces to indent the TAP stream\n */\n indent: string\n /**\n * TapWrap AsyncResource that limits the async-hook-domain\n *\n * @group Internal Machinery\n */\n hook: TapWrap\n // this actually is deterministically set in the ctor, but\n // in the hook, so tsc doesn't see it.\n /**\n * the async-hook-domain that catches throws and Promise rejections\n *\n * @group Internal Machinery\n */\n hookDomain!: Domain\n /**\n * The timer that fires when the test times out\n *\n * @group Internal Machinery\n */\n timer?: NodeJS.Timeout\n\n /**\n * Set to true when the test times out, so its failure status can be\n * determined later.\n */\n timedOut: boolean = false\n /**\n * The tap parser attached to this TAP stream\n *\n * @group Internal Machinery\n */\n parser: Parser\n /**\n * Method that writes to stderr when `debug: true` is set in the options,\n * or no-ops otherwise\n */\n debug: (...args: any[]) => void\n /**\n * The count of all assertions that this stream emitted\n *\n * @group Test Reflection\n */\n counts: Counts\n /**\n * Lists of todo, skip, and failure test points. If `passes: true` is\n * set in the options, then passing test points will also be tracked.\n *\n * @group Test Reflection\n */\n lists: Lists\n /**\n * the name of this test\n *\n * @group Test Reflection\n */\n name: string\n /**\n * Set on completion. The results of the test run.\n *\n * @group Test Reflection\n */\n results?: FinalResults\n /**\n * Parent test of this TAP stream\n *\n * @group Internal Machinery\n */\n parent?: Base | TestBase\n\n /**\n * Nesting level, for serialization to node test runner\n *\n * Note that this is zero for parent-less tests, and *also* zero\n * for the first level of children.\n */\n nestingLevel: number = 0\n\n /**\n * Bail out on the first failed test point\n */\n bail: boolean\n /**\n * Treat non-TAP data as an error.\n * May be set with `pragma +strict` in the TAP stream, or unset with\n * `pragma: -strict`.\n */\n strict: boolean\n /**\n * Do not emit the `TAP version 14` line at the start\n */\n omitVersion: boolean\n /**\n * Do not elide extraneous whitespace and empty lines.\n */\n preserveWhitespace: boolean\n\n /**\n * Unrecoverable TAP protocol errors in the stream\n *\n * @group Test Reflection\n */\n errors: TapError[]\n\n /**\n * Numeric identifier for this test\n */\n childId: number\n\n /**\n * Any arbitrary data that is provided to this test object. Often, this\n * is set in a `t.before()` or `t.beforeEach()` method. Scalar values\n * are inherited by child tests. Object values are extended in child\n * tests using `Object.create()`.\n */\n #context: any = unsetContext\n get context () {\n if (this.#context === unsetContext) this.#context = Object.create(null)\n return this.#context\n }\n set context (c: any) {\n this.#context = c\n }\n\n /**\n * the TAP stream data for buffered tests\n *\n * @internal\n *\n * @group Internal Machinery\n */\n output: string\n\n /**\n * True if this test should be buffered and only processed on completion\n *\n * @internal\n *\n * @group Internal Machinery\n */\n buffered: boolean\n\n /**\n * True if this test emitted a bailout\n *\n * @group Test Reflection\n */\n bailedOut: string | boolean\n\n /**\n * high resolution bigint time when this test started\n *\n * @group Internal Machinery\n */\n start: bigint\n #started: boolean = false\n\n /**\n * Amount of time in milliseconds that this test took to complete.\n *\n * @group Test Reflection\n */\n time: MILLISECONDS\n\n /**\n * High resolution time in ns that this test took to complete.\n *\n * @group Test Reflection\n */\n hrtime: bigint\n\n /**\n * True if this test should be buffered and only emit data if it fails\n */\n silent: boolean\n\n /**\n * A `Deferred` promise wrapper that is resolved when this test completes.\n *\n * @group Internal Machinery\n */\n deferred?: Deferred\n\n #printedOutput: boolean = false\n\n #writable: boolean = true\n\n constructor(options: BaseOpts = {}) {\n super({ encoding: 'utf8' })\n // always use the constructor name as toStringTag, so we get\n // [object Test] or [object TAP] and the appropriate typeName\n // in stack traces.\n Object.defineProperty(this, Symbol.toStringTag, {\n value: this.constructor.name,\n configurable: true,\n })\n // all tap streams are sync string minipasses\n this.hook = new TapWrap(this)\n this.options = options\n this.counts = new Counts()\n this.lists = new Lists()\n\n this.silent = !!options.silent\n\n this.bail = !!options.bail\n this.strict = !!options.strict\n this.omitVersion = !!options.omitVersion\n this.preserveWhitespace = options.preserveWhitespace !== false\n this.buffered = this.silent\n ? options.buffered === undefined\n : !!options.buffered\n this.bailedOut = false\n this.errors = []\n this.parent = options.parent\n if (this.parent?.parent) {\n this.nestingLevel = this.parent.nestingLevel + 1\n }\n\n this.time = 0\n this.hrtime = 0n\n this.start = 0n\n this.childId = options.childId || 0\n // do we need this? couldn't we just call the Minipass\n this.output = ''\n this.indent = options.indent || ''\n this.name = options.name || '(unnamed test)'\n this.hook.runInAsyncScope(() => {\n this.hookDomain = new Domain((er, type) => {\n /* c8 ignore start */\n if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n /* c8 ignore stop */\n ;(er as { tapCaught?: string }).tapCaught = type\n this.threw(er)\n })\n })\n this.debug = !!options.debug ? debug(this.name) : () => {}\n\n this.parser =\n options.parser ||\n new Parser({\n bail: this.bail,\n strict: this.strict,\n omitVersion: this.omitVersion,\n preserveWhitespace: this.preserveWhitespace,\n passes: this.options.passes,\n name: this.name,\n })\n this.#setupParser()\n\n // ensure that a skip or todo on a child class reverts\n // back to Base's no-op main.\n if (options.skip || options.todo) {\n this.main = Base.prototype.main\n }\n }\n\n #isFilterSkip(res: Result) {\n return (\n typeof res.skip === 'string' &&\n /^filter: (only|\\/.*\\/)$/.test(res.skip)\n )\n }\n\n #onParserResult(res: Result) {\n this.counts.total++\n const type = res.todo\n ? 'todo'\n : res.skip\n ? 'skip'\n : !res.ok\n ? 'fail'\n : 'pass'\n this.counts[type]++\n if (type === 'pass' && this.options.passes) {\n this.lists.pass.push(res)\n } else if (type === 'todo') {\n this.lists.todo.push(res)\n } else if (type === 'skip') {\n if (!this.#isFilterSkip(res)) this.lists.skip.push(res)\n } else if (type === 'fail') {\n this.lists.fail.push(res)\n }\n }\n\n #setupParser() {\n this.parser.on('line', l => this.#online(l))\n this.parser.once('bailout', reason => this.onbail(reason))\n this.parser.on('complete', result => this.oncomplete(result))\n this.parser.on('result', res => this.#onParserResult(res))\n }\n\n /**\n * Set the amount of time in milliseconds before this test is considered\n * a timeout. The time is counted from right now, so for example, repeatedly\n * calling `t.setTimeout(100)` can keep it going indefinitely, as long as\n * you call it more often than every 100ms.\n *\n * Calling `setTimeout(0)` will remove the timer and allow the test to run\n * indefinitely.\n *\n * @group Test Lifecycle Management\n */\n setTimeout(n: MILLISECONDS) {\n if (this.timer) {\n clearTimeout(this.timer)\n }\n if (n <= 0) {\n this.timer = undefined\n delete this.options.timeout\n } else {\n this.options.timeout = n\n this.timer = setTimeout(() => this.timeout(), n)\n /* c8 ignore start */\n if (this.timer.unref) this.timer.unref()\n /* c8 ignore stop */\n }\n }\n\n /**\n * Called when a timeout occurs. Only exposed because it has to be called\n * and/or extended by other classes, which all have their own sorts of\n * timeout behavior specific to the type of thing they represent.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n timeout(\n options: { expired?: string; message?: string } = {\n expired: this.name,\n message: 'timeout!',\n }\n ) {\n this.timedOut = true\n const { message = 'timeout!' } = options\n this.setTimeout(0)\n options.expired = options.expired || this.name\n // timeouts don't generally have a useful callsite information,\n // and no sense trying to capture it from @tapjs/stack\n const extra: Extra = {\n ...options,\n message,\n stack: '',\n at: {},\n }\n\n const threw = this.threw({ message }, extra)\n delete extra.stack\n delete extra.at\n if (threw) {\n this.emit('timeout', threw)\n }\n }\n\n /**\n * Run the `main` test function. Called by\n * {@link @tapjs/core!test-base.TestBase} when starting a subtest.\n * Initializes the TapWrap hook\n *\n * @internal\n *\n * @group Internal Machinery\n */\n runMain(cb: () => void) {\n this.debug('BASE runMain')\n this.start = hrtime.bigint()\n this.#started = true\n\n // if it's null or an object, inherit from it. otherwise, copy it.\n const ctx =\n this.#context !== unsetContext ? this.#context :\n ('context' in this.options\n ? this.options.context\n : this.parent?.context) ??\n null\n this.#context = typeof ctx === 'object' ? Object.create(ctx) : ctx\n\n this.hook.runInAsyncScope(this.main, this, cb)\n }\n\n /**\n * Returns true if this test has begun\n *\n * @group Test Reflection\n */\n get started() {\n return this.#started\n }\n\n /**\n * True if the test has printed *some* output of any kind\n *\n * @group Test Reflection\n */\n get printedOutput() {\n return this.#printedOutput\n }\n\n /**\n * Boolean indicating whether the underlying stream can be written to,\n * or if it has been ended.\n */\n get streamWritable() {\n return this.#writable\n }\n\n /**\n * The main test function. For this Base class, this is a no-op. Subclasses\n * implement this in their specific ways.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n main(cb: () => void) {\n cb()\n }\n\n /**\n * Stream write method.\n *\n * For buffered tests, this collects the output in the\n * {@link @tapjs/core!base.Base#output}\n * field. Sets {@link @tapjs/core!base.Base#printedOutput} to `true` when\n * called.\n *\n * Note: you *probably* never need to call this. Instead, use the various\n * assertion methods and other parts of the API.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n write(c: string) {\n this.#printedOutput = true\n if (this.buffered || this.silent) {\n // need the silent output if it fails\n this.output += c\n return true\n }\n\n if (!this.#writable) {\n return false\n }\n\n return super.write(c)\n }\n\n /**\n * Method called when the parser encounters a bail out\n *\n * Extended by {@link @tapjs/core!test-base.TestBase}\n */\n onbail(reason?: string) {\n this.bailedOut = reason || true\n this.emit('bailout', reason)\n }\n\n /**\n * Method called when parser emits a line of TAP data\n *\n * @internal\n *\n * @group Internal Machinery\n */\n #online(line: string) {\n this.debug('LINE %j', line, [this.name, this.indent])\n return this.write(this.indent + line)\n }\n\n /**\n * Method called when the parser completes and emits its final results\n *\n * Extended by {@link @tapjs/core!worker.Worker} and\n * {@link @tapjs/core!tap.TAP} classes\n *\n * @internal\n *\n * @group Internal Machinery\n */\n oncomplete(results: FinalResults) {\n if (this.start) {\n this.hrtime = hrtime.bigint() - this.start\n this.time =\n results.time || Math.floor(Number(this.hrtime) / 1000) / 1000\n }\n\n this.debug('ONCOMPLETE %j %j', this.name, results)\n\n // should only ever happen once, but just in case\n /* c8 ignore start */\n if (this.results) {\n Object.assign(results, this.results)\n }\n /* c8 ignore stop */\n\n this.results = results\n this.emit('complete', results)\n const errors = results.failures\n .filter(f => f.tapError)\n .map(f => {\n delete f.diag\n delete f.ok\n return f\n })\n\n if (errors.length) {\n this.errors = errors\n }\n\n this.#writable = false\n super.end()\n }\n\n /**\n * extension point for plugins that want to be notified when the test\n * is about to end, whether explicitly or implicitly.\n *\n * If the function returns a Promise, it will be awaited before ending\n * the TAP stream.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onbeforeend(): Promise | void {}\n\n /**\n * extension point for plugins that want to be notified when the test\n * is completely done, and terminating its parser.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n onEOF(): Promise | void {}\n\n /**\n * extension point for TestBase to know when a child tests is done being\n * processed and it's safe to move on to the next one.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n ondone() {}\n\n /**\n * EventEmitter emit method, but closes the\n * {@link @tapjs/core!base.Base#hook} and\n * {@link @tapjs/core!base.Base#hookDomain} when emitting `'end'`.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n emit(\n ev: Event,\n ...data: Events[Event]\n ) {\n const ret = super.emit(ev, ...data)\n if (ev === 'end') {\n this.ondone()\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n }\n return ret\n }\n\n /**\n * Mark the test as ended. In this base class, this is a no-op, but\n * in {@link @tapjs/core!test-base.TestBase}, it also triggers the other\n * end-of-test operations.\n */\n end() {\n return this\n }\n\n /**\n * Method called when an unrecoverable error is encountered in a test.\n *\n * Typically, in tests you would not call this, you'd just actually throw\n * an error.\n *\n * @internal\n *\n * @group Internal Machinery\n */\n threw(\n er: any,\n extra?: Extra,\n proxy: boolean = false,\n ended: boolean = false\n ): Extra | void | undefined {\n this.debug('BASE.threw', er)\n this.hook.emitDestroy()\n this.hookDomain.destroy()\n if (typeof er === 'string') {\n er = { message: er }\n } else if (!er || typeof er !== 'object') {\n er = { error: er }\n }\n if (this.name && !proxy) {\n er.test = this.name\n }\n\n const message = messageFromError(er)\n if (!extra) {\n extra = extraFromError(er, extra)\n }\n extra.message = message\n\n this.parser.ok = false\n\n // if possible to handle it here, then return the info so that this\n // Base subclass can do its thing\n if (\n !ended &&\n !this.results &&\n /* c8 ignore start */\n (this.parser.planEnd === -1 ||\n this.parser.count < this.parser.planEnd)\n /* c8 ignore stop */\n ) {\n return extra\n }\n\n // if we ended, we have to report it SOMEWHERE, unless we're\n // already in the process of bailing out, in which case it's\n // a bit excessive. Do not print it here if it would trigger\n // a plan exceeded error, or if we already have results.\n this.debug(\n 'Base.threw, but finished',\n this.name,\n this.results,\n extra.message\n )\n const alreadyBailing =\n (this.results?.ok === false && this.bail) ||\n this.parser.bailedOut ||\n this.results?.bailout\n if (this.results) this.results.ok = false\n if (this.parent) {\n this.parent.threw(er, extra, true)\n } else if (!alreadyBailing) {\n // not already bailing out, so print the error as best we can\n if (!er.stack) {\n console.error(er)\n } else {\n /* c8 ignore start */\n const name = er.name || 'Error'\n /* c8 ignore stop */\n console.error('%s: %s', name, extra.message)\n console.error(diags(extra))\n }\n }\n // we are already bailing out, and this is the top level,\n // just make our way hastily to the nearest exit.\n }\n\n /**\n * returns true if the test has not as yet encountered any failures\n *\n * @group Test Reflection\n */\n passing() {\n return this.parser.ok && this.results?.ok !== false\n }\n}\n"]} \ No newline at end of file diff --git a/src/core/src/base.ts b/src/core/src/base.ts index fa711b1aa..40c3ac334 100644 --- a/src/core/src/base.ts +++ b/src/core/src/base.ts @@ -18,6 +18,8 @@ import type { Extra, TestBase } from './index.js' import { Lists } from './lists.js' import { messageFromError } from './message-from-error.js' +const unsetContext = Symbol('TAP.context unset') + /** * Events emitted by the Base class */ @@ -340,7 +342,14 @@ export class Base< * are inherited by child tests. Object values are extended in child * tests using `Object.create()`. */ - context: any + #context: any = unsetContext + get context () { + if (this.#context === unsetContext) this.#context = Object.create(null) + return this.#context + } + set context (c: any) { + this.#context = c + } /** * the TAP stream data for buffered tests @@ -590,12 +599,12 @@ export class Base< // if it's null or an object, inherit from it. otherwise, copy it. const ctx = - this.context ?? + this.#context !== unsetContext ? this.#context : ('context' in this.options ? this.options.context : this.parent?.context) ?? null - this.context = typeof ctx === 'object' ? Object.create(ctx) : ctx + this.#context = typeof ctx === 'object' ? Object.create(ctx) : ctx this.hook.runInAsyncScope(this.main, this, cb) } diff --git a/src/core/tap-snapshots/test/base.ts.test.cjs b/src/core/tap-snapshots/test/base.ts.test.cjs index aa82fe627..fa107445e 100644 --- a/src/core/tap-snapshots/test/base.ts.test.cjs +++ b/src/core/tap-snapshots/test/base.ts.test.cjs @@ -6,11 +6,11 @@ */ 'use strict' exports[`test/base.ts > TAP > basic instantiation > context after main 1`] = ` -Null Object {} +Object {} ` exports[`test/base.ts > TAP > basic instantiation > context before main 1`] = ` -undefined +Null Object {} ` exports[`test/base.ts > TAP > basic instantiation > must match snapshot 1`] = ` diff --git a/src/core/test/base.ts b/src/core/test/base.ts index 6981589c7..0c80c7da7 100644 --- a/src/core/test/base.ts +++ b/src/core/test/base.ts @@ -402,3 +402,12 @@ t.test('results.ok=false means not passing', async t => { tb.results.ok = false t.equal(tb.passing(), false, 'not ok results, not passing()') }) + +t.test('context looks like an object when not yet set', t => { + const tb = new Minimal({ name: 'ctx tester' }) + t.strictSame(tb.context, Object.create(null)) + const c = {} + tb.context = c + t.equal(tb.context, c) + t.end() +})