Clone of baretest with reporting
 
Go to file
Frédéric Matte 28a0dad16a The method only should have the same signature as the runner function 2022-12-01 00:34:42 -05:00
.gitignore First implementation of the metaltest 2022-11-08 22:29:58 -05:00
LICENSE Initial commit 2022-11-05 16:03:00 -04:00
README.md How to use 2022-11-08 22:42:26 -05:00
consolereporter.js First implementation of the metaltest 2022-11-08 22:29:58 -05:00
index.js The method only should have the same signature as the runner function 2022-12-01 00:34:42 -05:00
package-lock.json First implementation of the metaltest 2022-11-08 22:29:58 -05:00
package.json First implementation of the metaltest 2022-11-08 22:29:58 -05:00
runifmain.js First implementation of the metaltest 2022-11-08 22:29:58 -05:00
test.js First implementation of the metaltest 2022-11-08 22:29:58 -05:00
totalreporter.js First implementation of the metaltest 2022-11-08 22:29:58 -05:00

README.md

metaltest

Clone of baretest with reporting

How to use

import assert from "node:assert/strict";
import metaltest from "metaltest";
const test = metaltest("Metaltest");
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("Metaltest");
test("test 1", () => {
  assert.equal(1, 1);
});
export { test };

suite.js

const { test } = await import("test.js");
await test.run(consolereporter());