@tapjs/core
Advanced tools
Comparing version 1.3.9 to 1.3.10
@@ -296,2 +296,30 @@ "use strict"; | ||
} | ||
#isFilterSkip(res) { | ||
return (typeof res.skip === 'string' && | ||
/^filter: (only|\/.*\/)$/.test(res.skip)); | ||
} | ||
#onParserResult(res) { | ||
this.counts.total++; | ||
const type = res.todo | ||
? 'todo' | ||
: res.skip | ||
? 'skip' | ||
: !res.ok | ||
? 'fail' | ||
: 'pass'; | ||
this.counts[type]++; | ||
if (type === 'pass' && this.options.passes) { | ||
this.lists.pass.push(res); | ||
} | ||
else if (type === 'todo') { | ||
this.lists.todo.push(res); | ||
} | ||
else if (type === 'skip') { | ||
if (!this.#isFilterSkip(res)) | ||
this.lists.skip.push(res); | ||
} | ||
else if (type === 'fail') { | ||
this.lists.fail.push(res); | ||
} | ||
} | ||
#setupParser() { | ||
@@ -301,25 +329,3 @@ this.parser.on('line', l => this.#online(l)); | ||
this.parser.on('complete', result => this.oncomplete(result)); | ||
this.parser.on('result', () => this.counts.total++); | ||
this.parser.on('pass', res => { | ||
if (this.options.passes) { | ||
this.lists.pass.push(res); | ||
} | ||
this.counts.pass++; | ||
}); | ||
this.parser.on('todo', res => { | ||
this.counts.todo++; | ||
this.lists.todo.push(res); | ||
}); | ||
this.parser.on('skip', res => { | ||
// it is uselessly noisy to print out lists of tests skipped | ||
// because of a --grep or --only argument. | ||
if (/^filter: (only|\/.*\/)$/.test(res.skip)) | ||
return; | ||
this.counts.skip++; | ||
this.lists.skip.push(res); | ||
}); | ||
this.parser.on('fail', res => { | ||
this.counts.fail++; | ||
this.lists.fail.push(res); | ||
}); | ||
this.parser.on('result', res => this.#onParserResult(res)); | ||
} | ||
@@ -421,3 +427,5 @@ /** | ||
*/ | ||
get streamWritable() { return this.#writable; } | ||
get streamWritable() { | ||
return this.#writable; | ||
} | ||
/** | ||
@@ -650,3 +658,3 @@ * The main test function. For this Base class, this is a no-op. Subclasses | ||
passing() { | ||
return this.parser.ok && (this.results?.ok !== false); | ||
return this.parser.ok && this.results?.ok !== false; | ||
} | ||
@@ -653,0 +661,0 @@ } |
@@ -9,4 +9,9 @@ "use strict"; | ||
const mainScript = (def = 'TAP') => { | ||
if ( | ||
//@ts-ignore | ||
if (typeof repl !== 'undefined' || proc_js_1.proc._forceRepl || '_eval' in proc_js_1.proc) { | ||
typeof repl !== 'undefined' || | ||
//@ts-ignore | ||
proc_js_1.proc._forceRepl || | ||
//@ts-ignore | ||
'_eval' in proc_js_1.proc) { | ||
return def; | ||
@@ -13,0 +18,0 @@ } |
@@ -159,3 +159,4 @@ "use strict"; | ||
!signal) { | ||
this.options.skip = this.results.plan.skipReason || 'no tests found'; | ||
this.options.skip = | ||
this.results.plan.skipReason || 'no tests found'; | ||
} | ||
@@ -162,0 +163,0 @@ if (code || signal) { |
@@ -226,3 +226,3 @@ /// <reference types="node" /> | ||
*/ | ||
assertTotals: Counts; | ||
get assertTotals(): Counts; | ||
/** | ||
@@ -229,0 +229,0 @@ * true if the test has printed at least one TestPoint |
@@ -46,3 +46,2 @@ "use strict"; | ||
const implicit_end_sigil_js_1 = require("./implicit-end-sigil.js"); | ||
const index_js_1 = require("./index.js"); | ||
const normalize_message_extra_js_1 = require("./normalize-message-extra.js"); | ||
@@ -164,9 +163,5 @@ const VERSION = 'TAP version 14\n'; | ||
*/ | ||
assertTotals = new index_js_1.Counts({ | ||
total: 0, | ||
fail: 0, | ||
pass: 0, | ||
skip: 0, | ||
todo: 0, | ||
}); | ||
get assertTotals() { | ||
return this.counts; | ||
} | ||
/** | ||
@@ -191,3 +186,2 @@ * true if the test has printed at least one TestPoint | ||
this.parser.on('result', r => { | ||
this.#onParserResult(r); | ||
this.emit('assert', r); | ||
@@ -1127,6 +1121,2 @@ }); | ||
} | ||
#onParserResult(r) { | ||
this.assertTotals.total++; | ||
this.assertTotals[r.todo ? 'todo' : r.skip ? 'skip' : !r.ok ? 'fail' : 'pass']++; | ||
} | ||
/** | ||
@@ -1133,0 +1123,0 @@ * Method called when an unrecoverable error is encountered in a test. |
@@ -292,2 +292,30 @@ /** | ||
} | ||
#isFilterSkip(res) { | ||
return (typeof res.skip === 'string' && | ||
/^filter: (only|\/.*\/)$/.test(res.skip)); | ||
} | ||
#onParserResult(res) { | ||
this.counts.total++; | ||
const type = res.todo | ||
? 'todo' | ||
: res.skip | ||
? 'skip' | ||
: !res.ok | ||
? 'fail' | ||
: 'pass'; | ||
this.counts[type]++; | ||
if (type === 'pass' && this.options.passes) { | ||
this.lists.pass.push(res); | ||
} | ||
else if (type === 'todo') { | ||
this.lists.todo.push(res); | ||
} | ||
else if (type === 'skip') { | ||
if (!this.#isFilterSkip(res)) | ||
this.lists.skip.push(res); | ||
} | ||
else if (type === 'fail') { | ||
this.lists.fail.push(res); | ||
} | ||
} | ||
#setupParser() { | ||
@@ -297,25 +325,3 @@ this.parser.on('line', l => this.#online(l)); | ||
this.parser.on('complete', result => this.oncomplete(result)); | ||
this.parser.on('result', () => this.counts.total++); | ||
this.parser.on('pass', res => { | ||
if (this.options.passes) { | ||
this.lists.pass.push(res); | ||
} | ||
this.counts.pass++; | ||
}); | ||
this.parser.on('todo', res => { | ||
this.counts.todo++; | ||
this.lists.todo.push(res); | ||
}); | ||
this.parser.on('skip', res => { | ||
// it is uselessly noisy to print out lists of tests skipped | ||
// because of a --grep or --only argument. | ||
if (/^filter: (only|\/.*\/)$/.test(res.skip)) | ||
return; | ||
this.counts.skip++; | ||
this.lists.skip.push(res); | ||
}); | ||
this.parser.on('fail', res => { | ||
this.counts.fail++; | ||
this.lists.fail.push(res); | ||
}); | ||
this.parser.on('result', res => this.#onParserResult(res)); | ||
} | ||
@@ -417,3 +423,5 @@ /** | ||
*/ | ||
get streamWritable() { return this.#writable; } | ||
get streamWritable() { | ||
return this.#writable; | ||
} | ||
/** | ||
@@ -646,5 +654,5 @@ * The main test function. For this Base class, this is a no-op. Subclasses | ||
passing() { | ||
return this.parser.ok && (this.results?.ok !== false); | ||
return this.parser.ok && this.results?.ok !== false; | ||
} | ||
} | ||
//# sourceMappingURL=base.js.map |
@@ -6,4 +6,9 @@ import { argv, proc } from './proc.js'; | ||
export const mainScript = (def = 'TAP') => { | ||
if ( | ||
//@ts-ignore | ||
if (typeof repl !== 'undefined' || proc._forceRepl || '_eval' in proc) { | ||
typeof repl !== 'undefined' || | ||
//@ts-ignore | ||
proc._forceRepl || | ||
//@ts-ignore | ||
'_eval' in proc) { | ||
return def; | ||
@@ -10,0 +15,0 @@ } |
@@ -156,3 +156,4 @@ import { Base } from './base.js'; | ||
!signal) { | ||
this.options.skip = this.results.plan.skipReason || 'no tests found'; | ||
this.options.skip = | ||
this.results.plan.skipReason || 'no tests found'; | ||
} | ||
@@ -159,0 +160,0 @@ if (code || signal) { |
@@ -226,3 +226,3 @@ /// <reference types="node" resolution-mode="require"/> | ||
*/ | ||
assertTotals: Counts; | ||
get assertTotals(): Counts; | ||
/** | ||
@@ -229,0 +229,0 @@ * true if the test has printed at least one TestPoint |
@@ -17,3 +17,2 @@ import * as stack from '@tapjs/stack'; | ||
import { IMPLICIT } from './implicit-end-sigil.js'; | ||
import { Counts, } from './index.js'; | ||
import { normalizeMessageExtra } from './normalize-message-extra.js'; | ||
@@ -135,9 +134,5 @@ const VERSION = 'TAP version 14\n'; | ||
*/ | ||
assertTotals = new Counts({ | ||
total: 0, | ||
fail: 0, | ||
pass: 0, | ||
skip: 0, | ||
todo: 0, | ||
}); | ||
get assertTotals() { | ||
return this.counts; | ||
} | ||
/** | ||
@@ -162,3 +157,2 @@ * true if the test has printed at least one TestPoint | ||
this.parser.on('result', r => { | ||
this.#onParserResult(r); | ||
this.emit('assert', r); | ||
@@ -1098,6 +1092,2 @@ }); | ||
} | ||
#onParserResult(r) { | ||
this.assertTotals.total++; | ||
this.assertTotals[r.todo ? 'todo' : r.skip ? 'skip' : !r.ok ? 'fail' : 'pass']++; | ||
} | ||
/** | ||
@@ -1104,0 +1094,0 @@ * Method called when an unrecoverable error is encountered in a test. |
{ | ||
"name": "@tapjs/core", | ||
"version": "1.3.9", | ||
"version": "1.3.10", | ||
"description": "pluggable core of node-tap", | ||
@@ -56,3 +56,3 @@ "tshy": { | ||
"@tapjs/stack": "1.2.5", | ||
"@tapjs/test": "1.3.9", | ||
"@tapjs/test": "1.3.10", | ||
"async-hook-domain": "^4.0.1", | ||
@@ -63,5 +63,5 @@ "diff": "^5.1.0", | ||
"signal-exit": "4.1", | ||
"tap-parser": "15.2.0", | ||
"tap-parser": "15.2.1", | ||
"tap-yaml": "2.2.0", | ||
"tcompare": "6.4.2", | ||
"tcompare": "6.4.3", | ||
"trivial-deferred": "^2.0.0" | ||
@@ -68,0 +68,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10501
848287
+ Added@tapjs/after@1.1.10(transitive)
+ Added@tapjs/after-each@1.1.10(transitive)
+ Added@tapjs/asserts@1.1.10(transitive)
+ Added@tapjs/before@1.1.10(transitive)
+ Added@tapjs/before-each@1.1.10(transitive)
+ Added@tapjs/filter@1.2.10(transitive)
+ Added@tapjs/fixture@1.2.10(transitive)
+ Added@tapjs/intercept@1.2.10(transitive)
+ Added@tapjs/mock@1.2.8(transitive)
+ Added@tapjs/node-serialize@1.1.10(transitive)
+ Added@tapjs/snapshot@1.2.10(transitive)
+ Added@tapjs/spawn@1.1.10(transitive)
+ Added@tapjs/stdin@1.1.10(transitive)
+ Added@tapjs/test@1.3.10(transitive)
+ Added@tapjs/typescript@1.2.10(transitive)
+ Added@tapjs/worker@1.1.10(transitive)
+ Addedtap-parser@15.2.1(transitive)
+ Addedtcompare@6.4.3(transitive)
- Removed@tapjs/after@1.1.9(transitive)
- Removed@tapjs/after-each@1.1.9(transitive)
- Removed@tapjs/asserts@1.1.9(transitive)
- Removed@tapjs/before@1.1.9(transitive)
- Removed@tapjs/before-each@1.1.9(transitive)
- Removed@tapjs/filter@1.2.9(transitive)
- Removed@tapjs/fixture@1.2.9(transitive)
- Removed@tapjs/intercept@1.2.9(transitive)
- Removed@tapjs/mock@1.2.7(transitive)
- Removed@tapjs/node-serialize@1.1.9(transitive)
- Removed@tapjs/snapshot@1.2.9(transitive)
- Removed@tapjs/spawn@1.1.9(transitive)
- Removed@tapjs/stdin@1.1.9(transitive)
- Removed@tapjs/test@1.3.9(transitive)
- Removed@tapjs/typescript@1.2.9(transitive)
- Removed@tapjs/worker@1.1.9(transitive)
- Removedtap-parser@15.2.0(transitive)
- Removedtcompare@6.4.2(transitive)
Updated@tapjs/test@1.3.10
Updatedtap-parser@15.2.1
Updatedtcompare@6.4.3