Skip to content

Commit 3d468f3

Browse files
committed
test(utils): improve test data values
1 parent 9c655d5 commit 3d468f3

4 files changed

Lines changed: 16 additions & 16 deletions

File tree

packages/utils/src/lib/reports/__snapshots__/generate-md-report.integration.test.ts.snap

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`generateMdReport > should contain all sections when using the fixture r
55
66
|🏷 Category|⭐ Score|🛡 Audits|
77
|:--|:--:|:--:|
8-
|[Performance](#performance)|🟡 **74**|8|
8+
|[Performance](#performance)|🟢 **92**|8|
99
|[Bug prevention](#bug-prevention)|🟡 **68**|16|
1010
|[Code style](#code-style)|🟡 **54**|13|
1111
@@ -15,19 +15,19 @@ exports[`generateMdReport > should contain all sections when using the fixture r
1515
1616
Performance metrics [📖 Docs](https://developers.google.com/web/fundamentals/performance)
1717
18-
🟡 Score: **74**
18+
🟢 Score: **92**
1919
- 🟢 Performance (_Lighthouse_)
2020
- 🟩 [Total Blocking Time](#total-blocking-time-lighthouse) - **0 ms**
2121
- 🟨 [Largest Contentful Paint](#largest-contentful-paint-lighthouse) - **1.5 s**
2222
- 🟩 [Cumulative Layout Shift](#cumulative-layout-shift-lighthouse) - **0**
2323
- 🟨 [First Contentful Paint](#first-contentful-paint-lighthouse) - **1.2 s**
2424
- 🟩 [Speed Index](#speed-index-lighthouse) - **1.2 s**
2525
26-
- 🔴 ESLint performance rules (_ESLint_)
27-
- 🟥 [Disallow unused variables](#disallow-unused-variables-eslint) - **1 warning**
26+
- 🟥 [Disallow missing \`key\` props in iterators/collection literals](#disallow-missing-key-props-in-iterators-collection-literals-eslint) (_ESLint_) - **1 warning**
27+
- 🟢 Maximum lines limitation (_ESLint_)
2828
- 🟥 [Enforce a maximum number of lines of code in a function](#enforce-a-maximum-number-of-lines-of-code-in-a-function-eslint) - **1 warning**
29+
- 🟩 [Enforce a maximum number of lines per file](#enforce-a-maximum-number-of-lines-per-file-eslint) - **passed**
2930
30-
- 🟥 [Disallow missing \`key\` props in iterators/collection literals](#disallow-missing-key-props-in-iterators-collection-literals-eslint) (_ESLint_) - **1 warning**
3131
3232
### Bug prevention
3333

packages/utils/src/lib/reports/__snapshots__/generate-stdout-summary.integration.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Categories
7878
┌─────────────────────────────────────────────────────────────┬───────┬────────┐
7979
│ Category │ Score │ Audits │
8080
├─────────────────────────────────────────────────────────────┼───────┼────────┤
81-
│ Performance │ 74 │ 8 │
81+
│ Performance │ 92 │ 8 │
8282
├─────────────────────────────────────────────────────────────┼───────┼────────┤
8383
│ Bug prevention │ 68 │ 16 │
8484
├─────────────────────────────────────────────────────────────┼───────┼────────┤

testing/test-utils/src/lib/utils/dynamic-mocks/categories.mock.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ const CATEGORIES_MAP = {
1111
{
1212
type: 'group',
1313
plugin: 'eslint',
14-
slug: 'performance',
15-
weight: 1,
14+
slug: 'max-line-limitation',
15+
weight: 0,
1616
},
1717
{
1818
type: 'group',
1919
plugin: 'lighthouse',
2020
slug: 'performance',
21-
weight: 4,
21+
weight: 1,
2222
},
2323
eslintAuditRefMock('react-jsx-key', 0),
2424
],

testing/test-utils/src/lib/utils/dynamic-mocks/eslint-plugin.mock.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ import type {
99
import { ESLINT_AUDITS_MAP } from './eslint-audits.mock';
1010
import { echoRunnerConfigMock } from './runner-config.mock';
1111

12-
export const ESLINT_PLUGIN_GROUP_PERFORMANCE: Group = {
13-
slug: 'performance',
14-
title: 'ESLint performance rules',
12+
const ESLINT_PLUGIN_GROUP_MAX_LINES: Group = {
13+
slug: 'max-line-limitation',
14+
title: 'Maximum lines limitation',
1515
refs: [
1616
{
1717
slug: ESLINT_AUDITS_MAP['max-lines-per-function'].slug,
18-
weight: 10,
18+
weight: 1,
1919
},
2020
{
21-
slug: ESLINT_AUDITS_MAP['no-unused-vars'].slug,
22-
weight: 25,
21+
slug: ESLINT_AUDITS_MAP['max-lines'].slug,
22+
weight: 1,
2323
},
2424
],
2525
};
@@ -59,7 +59,7 @@ export function eslintPluginReportMock(): PluginReport {
5959
date: '2023-10-18T07:49:45.531Z',
6060
duration: 368,
6161
audits: Object.values(ESLINT_AUDITS_MAP),
62-
groups: [ESLINT_PLUGIN_GROUP_PERFORMANCE],
62+
groups: [ESLINT_PLUGIN_GROUP_MAX_LINES],
6363
};
6464
}
6565

0 commit comments

Comments
 (0)