|
1 | 1 | import os from 'node:os';
|
2 | 2 | import path from 'node:path';
|
| 3 | +import process from 'node:process'; |
3 | 4 | import { fileURLToPath } from 'node:url';
|
4 | 5 | import { type MockInstance, describe, expect, it } from 'vitest';
|
5 | 6 | import type {
|
@@ -63,33 +64,36 @@ describe('executeRunner', () => {
|
63 | 64 | expect(osAgnosticAuditOutputs(json)).toMatchSnapshot();
|
64 | 65 | });
|
65 | 66 |
|
66 |
| - it('should execute runner with custom config using @code-pushup/eslint-config', async () => { |
67 |
| - const runnerPaths = await createPluginConfig( |
68 |
| - 'code-pushup.eslint.config.mjs', |
69 |
| - ); |
70 |
| - await executeRunner(runnerPaths); |
| 67 | + it.skipIf(process.platform === 'win32')( |
| 68 | + 'should execute runner with custom config using @code-pushup/eslint-config', |
| 69 | + async () => { |
| 70 | + const runnerPaths = await createPluginConfig( |
| 71 | + 'code-pushup.eslint.config.mjs', |
| 72 | + ); |
| 73 | + await executeRunner(runnerPaths); |
71 | 74 |
|
72 |
| - const json = await readJsonFile<AuditOutput[]>( |
73 |
| - runnerPaths.runnerOutputPath, |
74 |
| - ); |
75 |
| - // expect warnings from unicorn/filename-case rule from default config |
76 |
| - expect(json).toContainEqual( |
77 |
| - expect.objectContaining<Partial<AuditOutput>>({ |
78 |
| - slug: 'unicorn-filename-case', |
79 |
| - displayValue: expect.stringMatching(/^\d+ warnings?$/), |
80 |
| - details: { |
81 |
| - issues: expect.arrayContaining<Issue>([ |
82 |
| - { |
83 |
| - severity: 'warning', |
84 |
| - message: |
85 |
| - 'Filename is not in kebab case. Rename it to `use-todos.js`.', |
86 |
| - source: expect.objectContaining<Issue['source']>({ |
87 |
| - file: path.join(appDir, 'src', 'hooks', 'useTodos.js'), |
88 |
| - }), |
89 |
| - }, |
90 |
| - ]), |
91 |
| - }, |
92 |
| - }), |
93 |
| - ); |
94 |
| - }); |
| 75 | + const json = await readJsonFile<AuditOutput[]>( |
| 76 | + runnerPaths.runnerOutputPath, |
| 77 | + ); |
| 78 | + // expect warnings from unicorn/filename-case rule from default config |
| 79 | + expect(json).toContainEqual( |
| 80 | + expect.objectContaining<Partial<AuditOutput>>({ |
| 81 | + slug: 'unicorn-filename-case', |
| 82 | + displayValue: expect.stringMatching(/^\d+ warnings?$/), |
| 83 | + details: { |
| 84 | + issues: expect.arrayContaining<Issue>([ |
| 85 | + { |
| 86 | + severity: 'warning', |
| 87 | + message: |
| 88 | + 'Filename is not in kebab case. Rename it to `use-todos.js`.', |
| 89 | + source: expect.objectContaining<Issue['source']>({ |
| 90 | + file: path.join(appDir, 'src', 'hooks', 'useTodos.js'), |
| 91 | + }), |
| 92 | + }, |
| 93 | + ]), |
| 94 | + }, |
| 95 | + }), |
| 96 | + ); |
| 97 | + }, |
| 98 | + ); |
95 | 99 | }, 20_000);
|
0 commit comments