Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log(
` expected:\n${chalk.blue(
indentLines(8, JSON.stringify(data.expected, null, 2))
)}`
);
console.log(
` actual :\n${chalk.blue(
indentLines(8, JSON.stringify(data.actual, null, 2))
)}`
);
}
console.log("");
}
}
});
const harness = tape.getHarness({
exit: false,
stream: parser,
objectMode: true,
});
let testFiles = specifiedFiles;
if (testFiles.length === 0) {
if (chatty) {
console.log(chalk.blue(`looking for tests in ${srcDir}`));
}
testFiles = glob("**/*[.-]spec.ts", { cwd: srcDir });
if (!thorough) {
// exclude files containing slow.spec if not during a thorough run
testFiles = testFiles.filter(f => !/slow\.spec/.test(f));
}
}
}
$target.appendChild($line);
window.scrollTo(0, document.body.clientHeight);
}
['log', 'error', 'info'].forEach(k => {
var original = console[k];
console[k] = function (...args) {
addLine(k, [...args].join(' '));
original.call(console, ...args);
};
});
// Wait for tape to finish
const tapeResults = require("tape").getHarness()._results;
tapeResults.on("done", function (): void {
const payload = {
total: tapeResults.count,
passed: tapeResults.pass,
failed: tapeResults.fail,
};
const xhr = new XMLHttpRequest();
xhr.open("POST", `http://localhost:5001?id=${id}`, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Origin", location.origin);
xhr.send(JSON.stringify(payload));
xhr.onerror = function () {
console.error(`collector ${id} failed:`, xhr.status, xhr.responseText);
console.error(xhr.getAllResponseHeaders());
};
.then(() => {
test.getHarness()._results.count += total - start;
test.getHarness()._results.pass += passed;
test.getHarness()._results.fail += failed;
t.end();
})
.catch(err => console.error(err));
modify('before', async function before({ config }) {
output = tape.createStream();
harness = tape.getHarness();
output.on('data', line => console.log(line.trimRight()));
});
.then(callback)
})
},
flush (callback) {
executionQueue(() => {
global.polendinaEnd(failures)
.catch(callback)
.then(callback)
})
}
})
tape.getHarness({ stream })
tape.getHarness().onFailure((...args) => {
failures = 1
})
for (const mod of registry.tests) {
mod.load()
}
}
global.polendinaWrite(chunk.toString())
.catch(callback)
.then(callback)
})
},
flush (callback) {
executionQueue(() => {
global.polendinaEnd(failures)
.catch(callback)
.then(callback)
})
}
})
tape.getHarness({ stream })
tape.getHarness().onFailure((...args) => {
failures = 1
})
for (const mod of registry.tests) {
mod.load()
}
}