Skip to content

Commit

Permalink
test: fix failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Mar 21, 2022
1 parent eca93a8 commit abf576a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"lint:tsc:test": "tsc -p tsconfig.test.json --noEmit",
"lint:eslint": "eslint --ignore-pattern '/fixtures/' --ignore-pattern '/e2e-test/' .",
"lint:prettier": "prettier --check .",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --colors",
"test": "FORCE_HYPERLINK=1 NODE_OPTIONS=--experimental-vm-modules jest --colors",
"postbuild:test": "./run-e2e-test.sh",
"postbuild:benchmark": "node benchmark/run.js"
},
Expand Down
14 changes: 7 additions & 7 deletions src/__snapshots__/core.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1678,20 +1678,20 @@ exports[`Core printSummaryOfResults 1`] = `
┌─────────────────────────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
semi │ [31m[1m14[22m[39m │ [31m[1m1[22m[39m │ [31m[1m15[22m[39m │ 0 │
]8;;https://eslint.org/docs/rules/semisemi]8;; │ [31m[1m14[22m[39m │ [31m[1m1[22m[39m │ [31m[1m15[22m[39m │ 0 │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ import/order │ [31m[1m3[22m[39m │ 0 │ [31m[1m3[22m[39m │ 0 │
]8;;https://github.com/import-js/eslint-plugin-import/blob/v2.25.4/docs/rules/order.mdimport/order]8;; │ [31m[1m3[22m[39m │ 0 │ [31m[1m3[22m[39m │ 0 │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ prefer-const │ [31m[1m4[22m[39m │ 0 │ [31m[1m4[22m[39m │ 0 │
]8;;https://eslint.org/docs/rules/prefer-constprefer-const]8;; │ [31m[1m4[22m[39m │ 0 │ [31m[1m4[22m[39m │ 0 │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ no-unused-vars │ [31m[1m11[22m[39m │ 0 │ 0 │ 0 │
]8;;https://eslint.org/docs/rules/no-unused-varsno-unused-vars]8;; │ [31m[1m11[22m[39m │ 0 │ 0 │ 0 │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ ban-exponentiation-operator │ 2 │ 0 │ 0 │ 0 │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ no-useless-escape │ [31m[1m5[22m[39m │ 0 │ 0 │ [31m[1m5[22m[39m │
]8;;https://eslint.org/docs/rules/no-useless-escapeno-useless-escape]8;; │ [31m[1m5[22m[39m │ 0 │ 0 │ [31m[1m5[22m[39m │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ no-unsafe-negation │ [31m[1m5[22m[39m │ 0 │ 0 │ [31m[1m5[22m[39m │
]8;;https://eslint.org/docs/rules/no-unsafe-negationno-unsafe-negation]8;; │ [31m[1m5[22m[39m │ 0 │ 0 │ [31m[1m5[22m[39m │
├─────────────────────────────┼───────┼─────────┼────────────┼─────────────────┤
│ arrow-body-style │ [31m[1m12[22m[39m │ 0 │ [31m[1m12[22m[39m │ 0 │
]8;;https://eslint.org/docs/rules/arrow-body-stylearrow-body-style]8;; │ [31m[1m12[22m[39m │ 0 │ [31m[1m12[22m[39m │ 0 │
└─────────────────────────────┴───────┴─────────┴────────────┴─────────────────┘"
`;
72 changes: 36 additions & 36 deletions src/formatter/format-by-rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ describe('formatByRules', () => {
];
const formattedText = formatByRules(results);
expect(stripAnsi(formattedText)).toMatchInlineSnapshot(`
"┌────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ 8 │ 5 │ 3 │ 6 │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ 1 │ 0 │ 0 │ 0 │
└────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
"┌────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ 8 │ 5 │ 3 │ 6 │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ 1 │ 0 │ 0 │ 0 │
└────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
expect(formattedText).toMatchInlineSnapshot(`
"┌────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ [31m[1m8[22m[39m │ [31m[1m5[22m[39m │ [31m[1m3[22m[39m │ [31m[1m6[22m[39m │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
└────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
"┌────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ [31m[1m8[22m[39m │ [31m[1m5[22m[39m │ [31m[1m3[22m[39m │ [31m[1m6[22m[39m │
├────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
└────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
});
test('prints link', () => {
const results: ESLint.LintResult[] = [
Expand All @@ -64,26 +64,26 @@ describe('formatByRules', () => {
},
});
expect(stripAnsi(formattedText)).toMatchInlineSnapshot(`
"┌───────────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ 1 │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ 1 │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ plugin/rule-c │ 1 │ 0 │ 0 │ 0 │
└───────────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
"┌───────────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-a │ 1 │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ 1 │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ plugin/rule-c │ 1 │ 0 │ 0 │ 0 │
└───────────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
expect(formattedText).toMatchInlineSnapshot(`
"┌───────────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
rule-a │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
plugin/rule-c │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
└───────────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
"┌───────────────┬───────┬─────────┬────────────┬─────────────────┐
│ Rule │ Error │ Warning │ is fixable │ has suggestions │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ ]8;;https://example.com/rule-arule-a]8;; │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ rule-b │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
├───────────────┼───────┼─────────┼────────────┼─────────────────┤
│ ]8;;https://example.com/plugin/rule-cplugin/rule-c]8;; │ [31m[1m1[22m[39m │ 0 │ 0 │ 0 │
└───────────────┴───────┴─────────┴────────────┴─────────────────┘"
`);
});
});

1 comment on commit abf576a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: abf576a Previous: 575110e Ratio
fix-all-of-many-files (disablePerFile, loop: 1) 1189.1944499999954 ms 790.349978000042 ms 1.50
fix-overlapped-problems (disablePerLine, loop: 1) 101.71235499999602 ms 59.03937600000063 ms 1.72

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.