gustwind
gustwind copied to clipboard
Remove duplication from HTML parser tests
Example:
// --------------- testsuite.js
import * as sharedTest_A from "./sharedtest_A.js";
Deno.test({
name: "testFoo",
fn: async (t) => {
await t.step("sharedTest_A", async (t) => {
await sharedTest_A.testFoo(t);
await sharedTest_A.testBar(t);
});
// await t.step("sharedtest_B" async (t) => { ... });
}
})
// --------------- sharedtest_A.js
export async function testFoo(t) {
await t.step("test 1", async (t) => {
// do something
});
await t.step("test 2", async (t) => {
// do something
});
}
export async function testBar(t) {
await t.step("test 3", async (t) => {
// do something
});
await t.step("test 4", async (t) => {
// do something
});
}