Skip to content

Commit

Permalink
Added tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbhoski committed May 24, 2024
1 parent bc0db58 commit 08e9d03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/buildSummary.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('readJsonFile', () => {
{ name: 'Test Task', description: 'A test task', failed: false, skipped: false, duration: '00:00:10' },
],
});
mockReadFile.mockImplementation((path, options, callback) => {
mockReadFile.mockImplementation((path: string, options: { encoding: string; flag?: string } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void) => {
callback(null, mockData);
});

Expand All @@ -38,7 +38,7 @@ describe('readJsonFile', () => {
});

it('throws an error if the file cannot be read', async () => {
mockReadFile.mockImplementation((path, options, callback) => {
mockReadFile.mockImplementation((path: string, options: { encoding: string; flag?: string } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void) => {
callback(new Error('File not found'), null);
});

Expand Down

0 comments on commit 08e9d03

Please sign in to comment.