chore: keeps swc/register for playwright tests

This commit is contained in:
James
2023-01-10 15:53:41 -05:00
parent f1c342e05e
commit 441eb2c20c
3 changed files with 42 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
import getPort from 'get-port';
import swcRegister from '@swc/register';
import path from 'path';
import { v4 as uuid } from 'uuid';
import shelljs from 'shelljs';
@@ -40,6 +41,19 @@ export async function initPayloadTest(options: Options): Promise<{ serverURL: st
initOptions.express = express();
}
swcRegister({
sourceMaps: 'inline',
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
},
module: {
type: 'commonjs',
},
});
await payload.init(initOptions);
if (initOptions.express) {