Skip to content

Commit f1db1d6

Browse files
committed
test(plugin-eslint): skip flaky test on win platform
1 parent da99447 commit f1db1d6

File tree

1 file changed

+32
-28
lines changed

1 file changed

+32
-28
lines changed

packages/plugin-eslint/src/lib/runner.integration.test.ts

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os from 'node:os';
22
import path from 'node:path';
3+
import process from 'node:process';
34
import { fileURLToPath } from 'node:url';
45
import { type MockInstance, describe, expect, it } from 'vitest';
56
import type {
@@ -63,33 +64,36 @@ describe('executeRunner', () => {
6364
expect(osAgnosticAuditOutputs(json)).toMatchSnapshot();
6465
});
6566

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);
7174

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+
);
9599
}, 20_000);

0 commit comments

Comments
 (0)