Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tapjs/core

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/core - npm Package Compare versions

Comparing version 1.3.9 to 1.3.10

58

dist/commonjs/base.js

@@ -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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc