gustwind icon indicating copy to clipboard operation
gustwind copied to clipboard

Remove duplication from HTML parser tests

Open bebraw opened this issue 1 year ago • 0 comments

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
  });

}

bebraw avatar May 29 '24 11:05 bebraw