Skip to content

Commit d9a177e

Browse files
committed
test(plugin-lighthouse): use path matcher for output paths
1 parent 6926a6c commit d9a177e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/plugin-lighthouse/src/lib/runner/runner.unit.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { Config } from 'lighthouse';
22
import { runLighthouse } from 'lighthouse/cli/run.js';
33
import type { Result } from 'lighthouse/types/lhr/audit-result';
44
import { expect, vi } from 'vitest';
5-
import { osAgnosticPath } from '@code-pushup/test-utils';
65
import { ui } from '@code-pushup/utils';
76
import { DEFAULT_CLI_FLAGS } from './constants.js';
87
import { createRunnerFunction } from './runner.js';
@@ -139,7 +138,7 @@ describe('createRunnerFunction', () => {
139138
expect(runLighthouse).toHaveBeenCalledWith(
140139
'https://localhost:8080',
141140
expect.objectContaining({
142-
outputPath: osAgnosticPath(
141+
outputPath: expect.pathToMatch(
143142
'.code-pushup/lighthouse/lighthouse-report-1.json',
144143
),
145144
}),
@@ -148,7 +147,7 @@ describe('createRunnerFunction', () => {
148147
expect(runLighthouse).toHaveBeenCalledWith(
149148
'https://localhost:8081',
150149
expect.objectContaining({
151-
outputPath: osAgnosticPath(
150+
outputPath: expect.pathToMatch(
152151
'.code-pushup/lighthouse/lighthouse-report-2.json',
153152
),
154153
}),
@@ -219,7 +218,7 @@ describe('createRunnerFunction', () => {
219218
expect(runLighthouse).toHaveBeenCalledWith(
220219
'https://localhost:8080',
221220
expect.objectContaining({
222-
outputPath: osAgnosticPath(
221+
outputPath: expect.pathToMatch(
223222
'.code-pushup/lighthouse/lighthouse-report-1.json',
224223
),
225224
}),
@@ -228,7 +227,7 @@ describe('createRunnerFunction', () => {
228227
expect(runLighthouse).toHaveBeenCalledWith(
229228
'https://localhost:8081',
230229
expect.objectContaining({
231-
outputPath: osAgnosticPath(
230+
outputPath: expect.pathToMatch(
232231
'.code-pushup/lighthouse/lighthouse-report-2.json',
233232
),
234233
}),

packages/plugin-lighthouse/vitest.unit.config.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/path.matcher.ts',
2930
'../../testing/test-setup/src/lib/extend/ui-logger.matcher.ts',
3031
],
3132
},

0 commit comments

Comments
 (0)