Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/reporting/reportConversionResults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,34 @@ import { ConversionError } from "../errors/conversionError";
import { ConfigurationError } from "../errors/configurationError";

describe("reportConversionResults", () => {
it("logs a successful conversion when there is one converted rule", () => {
it("logs a successful conversion without notices when there is one converted rule without notices", () => {
// Arrange
const conversionResults = createEmptyConversionResults({
converted: new Map<string, ESLintRuleOptions>([
[
"tslint-rule-one",
{
ruleArguments: ["a", "b"],
ruleName: "tslint-rule-one",
ruleSeverity: "error",
},
],
]),
});

const logger = createStubLogger();

// Act
reportConversionResults({ logger }, conversionResults);

// Assert
expectEqualWrites(
logger.stdout.write,
`✨ 1 rule replaced with its ESLint equivalent. ✨${EOL}`,
);
});

it("logs a successful conversion with notices when there is one converted rule with notices", () => {
// Arrange
const conversionResults = createEmptyConversionResults({
converted: new Map<string, ESLintRuleOptions>([
Expand Down