Skip to content

Commit d1c67cf

Browse files
author
Josh Goldberg
authored
Filled in missing 100% unit test coverage in reportConversionResults.test.ts (#123)
1 parent d15d1c8 commit d1c67cf

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/reporting/reportConversionResults.test.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,34 @@ import { ConversionError } from "../errors/conversionError";
77
import { ConfigurationError } from "../errors/configurationError";
88

99
describe("reportConversionResults", () => {
10-
it("logs a successful conversion when there is one converted rule", () => {
10+
it("logs a successful conversion without notices when there is one converted rule without notices", () => {
11+
// Arrange
12+
const conversionResults = createEmptyConversionResults({
13+
converted: new Map<string, ESLintRuleOptions>([
14+
[
15+
"tslint-rule-one",
16+
{
17+
ruleArguments: ["a", "b"],
18+
ruleName: "tslint-rule-one",
19+
ruleSeverity: "error",
20+
},
21+
],
22+
]),
23+
});
24+
25+
const logger = createStubLogger();
26+
27+
// Act
28+
reportConversionResults({ logger }, conversionResults);
29+
30+
// Assert
31+
expectEqualWrites(
32+
logger.stdout.write,
33+
`✨ 1 rule replaced with its ESLint equivalent. ✨${EOL}`,
34+
);
35+
});
36+
37+
it("logs a successful conversion with notices when there is one converted rule with notices", () => {
1138
// Arrange
1239
const conversionResults = createEmptyConversionResults({
1340
converted: new Map<string, ESLintRuleOptions>([

0 commit comments

Comments
 (0)