fix unit tests
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 12m5s

This commit is contained in:
2025-12-29 17:18:52 -08:00
parent a94b2a97b1
commit 517a268307
5 changed files with 83 additions and 74 deletions

View File

@@ -12,11 +12,10 @@ vi.mock('util', async (importOriginal) => {
const actual = await importOriginal<typeof import('util')>();
return {
...actual,
default: actual,
promisify: (fn: Function) => {
return (...args: any[]) => {
return new Promise((resolve, reject) => {
fn(...args, (err: Error | null, stdout: unknown, stderr: unknown) => {
fn(...args, (err: Error | null, stdout: string, stderr: string) => {
if (err) {
// Attach stdout/stderr to the error object to mimic child_process.exec behavior
Object.assign(err, { stdout, stderr });
@@ -41,7 +40,6 @@ vi.mock('child_process', () => {
});
return {
default: { exec: mockExec },
exec: mockExec,
};
});