Skip to content

Commit 4380dfd

Browse files
committed
refactor(plugin-axe): improve setup script logging
1 parent 8dbbcac commit 4380dfd

File tree

1 file changed

+10
-6
lines changed
  • packages/plugin-axe/src/lib/runner

1 file changed

+10
-6
lines changed

packages/plugin-axe/src/lib/runner/setup.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,20 @@ export async function loadSetupScript(
3434
? setupScript
3535
: path.join(process.cwd(), setupScript);
3636

37-
logger.debug(`Resolved setup script path: ${absolutePath}`);
38-
3937
if (!(await fileExists(absolutePath))) {
4038
throw new Error(`Setup script not found: ${absolutePath}`);
4139
}
4240

43-
const module: unknown = await import(absolutePath);
44-
const validModule = await validateAsync(setupScriptModuleSchema, module, {
45-
filePath: absolutePath,
46-
});
41+
const validModule = await logger.task(
42+
`Loading setup script from ${absolutePath}`,
43+
async () => {
44+
const module: unknown = await import(absolutePath);
45+
const validated = await validateAsync(setupScriptModuleSchema, module, {
46+
filePath: absolutePath,
47+
});
48+
return { message: 'Setup script loaded successfully', result: validated };
49+
},
50+
);
4751

4852
return validModule.default;
4953
}

0 commit comments

Comments
 (0)