Skip to content

Commit 43048a6

Browse files
committed
test(plugin-coverage): update unit tests to use custom matchers
1 parent af0f0d9 commit 43048a6

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

packages/plugin-coverage/src/lib/runner/lcov/lcov-runner.unit.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { vol } from 'memfs';
22
import path from 'node:path';
33
import { describe, expect, it } from 'vitest';
4-
import { getLogMessages } from '@code-pushup/test-utils';
54
import { ui } from '@code-pushup/utils';
65
import { parseLcovFiles } from './lcov-runner.js';
76

@@ -99,11 +98,11 @@ end_of_record
9998
path.join('coverage', 'lcov.info'),
10099
]);
101100

102-
expect(getLogMessages(ui().logger)[0]).toContain(
101+
expect(ui()).toHaveLoggedMessage(
103102
`Coverage plugin: Empty lcov report file detected at ${path.join(
104103
'coverage',
105104
'lcov.info',
106-
)}`,
105+
)}.`,
107106
);
108107
});
109108
});

packages/plugin-coverage/tsconfig.test.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"vite.config.unit.ts",
99
"vite.config.integration.ts",
1010
"mocks/**/*.ts",
11-
"src/**/*.test.ts"
11+
"src/**/*.test.ts",
12+
"../../testing/test-setup/src/vitest.d.ts"
1213
]
1314
}

packages/plugin-coverage/vite.config.unit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default defineConfig({
2626
'../../testing/test-setup/src/lib/fs.mock.ts',
2727
'../../testing/test-setup/src/lib/console.mock.ts',
2828
'../../testing/test-setup/src/lib/reset.mocks.ts',
29+
'../../testing/test-setup/src/lib/extend/ui-logger.matcher.ts',
2930
],
3031
},
3132
});

0 commit comments

Comments
 (0)