test(server): watch mode (#2893)

This commit is contained in:
Alex Yang
2023-06-28 18:00:06 +08:00
parent b0d8c8e14f
commit 0eb11d14ad
2 changed files with 8 additions and 1 deletions

View File

@@ -12,7 +12,13 @@ const root = fileURLToPath(new URL('..', import.meta.url));
const testDir = resolve(root, 'src', 'tests');
const files = await readdir(testDir);
const sharedArgs = [...pkg.nodemonConfig.nodeArgs, '--test'];
const watchMode = process.argv.includes('--watch');
const sharedArgs = [
...pkg.nodemonConfig.nodeArgs,
'--test',
watchMode ? '--watch' : '',
];
const env = {
PATH: process.env.PATH,