Frédéric Matte 979f078ac3 | ||
---|---|---|
reporter | ||
.gitignore | ||
LICENSE | ||
README.md | ||
index.js | ||
package-lock.json | ||
package.json | ||
runifmain.js | ||
stackparser.js | ||
stackparser.test.js | ||
suite.js | ||
test.js |
README.md
metaltest
Clone of baretest with reporting
How to use
import assert from "node:assert/strict";
import metaltest from "metaltest";
const test = metaltest("Simple test");
test("test 1", () => {
assert.equal(1, 1);
});
test("test 2", () => {
assert.equal(2, 2);
});
const stats = await test.run();
/* Will return
{
title: 'Metaltest',
success: 2,
fail: 0,
total: 2,
testSuccess: [],
testFail: []
}
*/
How to report to the console
const stats = await test.run(consolereporter());
How to create a suite of test
test.js
import assert from "node:assert/strict";
import metaltest from "metaltest";
const test = metaltest("Simple test");
test("test 1", () => {
assert.equal(1, 1);
});
export { test };
suite.js
const { test } = await import("test.js");
await test.run(consolereporter());
Hot to easily run a suite of multiple test
suite.js
import { suite } from "metaltest";
await suite(); // Will run all test that are in the current folder recursively