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,6 +1,5 @@
import {join, dirname} from "node:path";
import test from "ava";
import {test, expect, jest} from "@jest/globals";
// Rollup * plugins
import { rollup } from "rollup";
@@ -27,7 +26,9 @@ const defaultAssetInclude = [
'**/*.(webm|mp4)',// video
];
test.serial('web-bundle', async (t) => {
jest.setTimeout(30*1000);// Bundling react + typescript is getting heavy
test('web-bundle', async () => {
const out = await runBrowserTest({
input: 'index.hbs',
treeshake: 'smallest',
@@ -67,8 +68,7 @@ test.serial('web-bundle', async (t) => {
}),
],
}, {
path: 'index.html',
log: t.log,
path: 'index.html'
},{
dir: 'output', // Output all files
format: 'es', // iifi and cjs should be added to tests
@@ -77,7 +77,7 @@ test.serial('web-bundle', async (t) => {
entryFileNames: '[name].[extname]',
assetFileNames: '[name].[extname]',
});
t.snapshot(out);
expect(out).toMatchSnapshot();
// const code = await getCode(bundle, output);
// debugPrintOutput('jsx-web-app',code);