mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Add tape-player 0.1.0 to devDependencies for logging output from tape test harness.
This commit is contained in:
parent
6dff816f82
commit
d171b6c6b7
4 changed files with 3 additions and 49 deletions
|
|
@ -48,6 +48,7 @@
|
|||
"markdownlint-rule-helpers": "~0.6.0",
|
||||
"rimraf": "~3.0.0",
|
||||
"tape": "~4.13.0",
|
||||
"tape-player": "~0.1.0",
|
||||
"toml": "~3.0.0",
|
||||
"tv4": "~1.3.0",
|
||||
"typescript": "~3.7.5",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const fs = require("fs");
|
|||
const path = require("path");
|
||||
const glob = require("glob");
|
||||
const tape = require("tape");
|
||||
require("./tape-reporter");
|
||||
require("tape-player");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
const { utf8Encoding } = require("../helpers");
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const pluginKatex = require("markdown-it-katex");
|
|||
const pluginSub = require("markdown-it-sub");
|
||||
const pluginSup = require("markdown-it-sup");
|
||||
const tape = require("tape");
|
||||
require("./tape-reporter");
|
||||
require("tape-player");
|
||||
const tv4 = require("tv4");
|
||||
const packageJson = require("../package.json");
|
||||
const markdownlint = require("../lib/markdownlint");
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
const tape = require("tape");
|
||||
const { EOL } = require("os");
|
||||
const { inspect } = require("util");
|
||||
const { stdout, stderr } = process;
|
||||
const inspectOptions = {
|
||||
"compact": true,
|
||||
"breakLength": Infinity
|
||||
};
|
||||
|
||||
let tests = 0;
|
||||
let assertions = 0;
|
||||
let failures = 0;
|
||||
|
||||
tape
|
||||
.createStream({ "objectMode": true })
|
||||
.on("data", (data) => {
|
||||
if (data.type === "test") {
|
||||
tests++;
|
||||
stdout.write(`${data.name}${EOL}`);
|
||||
} else if (data.id !== undefined) {
|
||||
assertions++;
|
||||
if (!data.ok) {
|
||||
failures++;
|
||||
stderr.write([
|
||||
` ${data.file}`,
|
||||
` Message: ${data.name}`,
|
||||
` Operator: ${data.operator}`,
|
||||
` Expected: ${inspect(data.expected, inspectOptions)}`,
|
||||
` Actual: ${inspect(data.actual, inspectOptions)}`,
|
||||
""
|
||||
].join(EOL));
|
||||
}
|
||||
}
|
||||
})
|
||||
.on("close", () => {
|
||||
stdout.write([
|
||||
"",
|
||||
`Tests: ${tests}`,
|
||||
`Asserts: ${assertions}`,
|
||||
`Failures: ${failures}`,
|
||||
""
|
||||
].join(EOL));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue