chore: switch to jest for testing

This commit is contained in:
2024-02-21 00:04:36 +01:00
parent 3b540d0c48
commit e46f668ac8
47 changed files with 50329 additions and 839 deletions

View File

@@ -1,5 +1,6 @@
import {resolve, join, dirname} from "node:path";
import test from "ava";
import {test, expect} from "@jest/globals";
import {runBrowserTest} from "../util/index.ts";
import html from "../../src/index.ts";
@@ -9,8 +10,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
process.chdir(join(__dirname, 'fixtures'));
test.serial('rewrite-url', async (t) => {
test('rewrite-url', async () => {
const out = await runBrowserTest({
input: {
['index']: 'index.html',
@@ -25,7 +25,6 @@ test.serial('rewrite-url', async (t) => {
}),
],
},{
log: t.log,
filterOutput:{
// TODO: Currently only need the "await getCode(bundle, output);" as output
},
@@ -35,8 +34,7 @@ test.serial('rewrite-url', async (t) => {
format: 'es', // iifi and cjs should be added to tests
sourcemap: true,// Test if #sourcemapUrl is not accidentally included in the html-output
});
t.snapshot(out.code); // Snapshot the result code
expect(out.code).toMatchSnapshot(); // Snapshot the result code
// const bundle = await rollup({
// input: {