Skip to content

Commit fdac41f

Browse files
committed
Improve coverage
1 parent e43bbc6 commit fdac41f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

node-src/tasks/report.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'url';
44
import { beforeEach, describe, expect, it, vi } from 'vitest';
55

66
import { generateReport } from './report';
7+
import { Context } from '../types';
78

89
const __dirname = path.dirname(fileURLToPath(import.meta.url));
910

@@ -100,4 +101,16 @@ describe('generateRport', () => {
100101
path.join(__dirname, '../../chromatic-build-1.xml')
101102
);
102103
});
104+
105+
it('skips report generation when junitReport is false', async () => {
106+
const ctx = {
107+
client,
108+
log: { ...log, debug: vi.fn() },
109+
options: { junitReport: false },
110+
build,
111+
} as any;
112+
await generateReport(ctx);
113+
expect(ctx.log.debug).toHaveBeenCalledWith('junit report not configured, skipping');
114+
expect(reportBuilder.writeTo).not.toHaveBeenCalled();
115+
});
103116
});

0 commit comments

Comments
 (0)