Skip to content

Commit 8338f73

Browse files
committed
refactor: fix int test 7
1 parent f00a6d7 commit 8338f73

File tree

2 files changed

+48
-49
lines changed

2 files changed

+48
-49
lines changed

packages/plugin-eslint/src/lib/eslint-plugin.int.test.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,24 @@ describe('eslintPlugin', () => {
8181
},
8282
);
8383

84-
expect(plugin.groups).toContainEqual({
85-
slug: 'type-safety',
86-
title: 'Type safety',
87-
refs: [
88-
{ slug: 'typescript-eslint-no-explicit-any', weight: 1 },
84+
expect(plugin.groups).toStrictEqual(
85+
expect.arrayContaining([
8986
{
90-
slug: 'typescript-eslint-no-unsafe-declaration-merging',
91-
weight: 1,
87+
slug: 'type-safety',
88+
title: 'Type safety',
89+
refs: [
90+
{ slug: 'typescript-eslint-no-explicit-any', weight: 1 },
91+
{
92+
slug: 'typescript-eslint-no-unsafe-declaration-merging',
93+
weight: 1,
94+
},
95+
{ slug: 'typescript-eslint-no-unsafe-function-type', weight: 1 },
96+
],
9297
},
93-
{ slug: 'typescript-eslint-no-unsafe-function-type', weight: 1 },
94-
],
95-
});
96-
expect(plugin.audits).toContainEqual(
97-
expect.objectContaining<Partial<Audit>>({
98-
slug: 'typescript-eslint-no-explicit-any',
99-
}),
98+
expect.objectContaining<Partial<Audit>>({
99+
slug: 'typescript-eslint-no-explicit-any',
100+
}),
101+
]),
100102
);
101103
});
102104

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

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -62,40 +62,37 @@ describe('executeRunner', () => {
6262
expect(osAgnosticAuditOutputs(res)).toMatchSnapshot();
6363
});
6464

65-
it.skipIf(process.platform === 'win32')(
66-
'should execute runner with custom config using @code-pushup/eslint-config',
67-
async () => {
68-
const eslintTarget = 'code-pushup.eslint.config.mjs';
69-
const runnerFn = await createRunnerFunction({
70-
audits: await createAudits(eslintTarget),
71-
targets: [
72-
{
73-
eslintrc: eslintTarget,
74-
patterns: '.',
75-
},
76-
],
77-
});
65+
it('should execute runner with custom config using @code-pushup/eslint-config', async () => {
66+
const eslintTarget = 'code-pushup.eslint.config.mjs';
67+
const runnerFn = await createRunnerFunction({
68+
audits: await createAudits(eslintTarget),
69+
targets: [
70+
{
71+
eslintrc: eslintTarget,
72+
patterns: '.',
73+
},
74+
],
75+
});
7876

79-
const json = await runnerFn({ outputDir: '' });
80-
// expect warnings from unicorn/filename-case rule from default config
81-
expect(json).toContainEqual(
82-
expect.objectContaining<Partial<AuditOutput>>({
83-
slug: 'unicorn-filename-case',
84-
displayValue: expect.stringMatching(/^\d+ warnings?$/),
85-
details: {
86-
issues: expect.arrayContaining<Issue>([
87-
{
88-
severity: 'warning',
89-
message:
90-
'Filename is not in kebab case. Rename it to `use-todos.js`.',
91-
source: expect.objectContaining<Issue['source']>({
92-
file: path.join(appDir, 'src', 'hooks', 'useTodos.js'),
93-
}),
94-
},
95-
]),
96-
},
97-
}),
98-
);
99-
},
100-
);
77+
const json = await runnerFn({ outputDir: '' });
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+
});
10198
}, 20_000);

0 commit comments

Comments
 (0)