Skip to content

Commit 272ece0

Browse files
committed
fix: adds test cases using the official Receita Federal example (12.ABC.345/01DE-35) to prevent future regressions
1 parent 009d9c0 commit 272ece0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/format-cnpj/format-cnpj.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,16 @@ describe("formatCnpj", () => {
116116
"46.ABC.843/4850-00",
117117
);
118118
});
119+
120+
it("should allow all alphabet letters for version 2 (including E, O, T, U)", () => {
121+
expect(formatCnpj("12ABC34501DE35", { version: 2 })).toBe(
122+
"12.ABC.345/01DE-35"
123+
);
124+
expect(formatCnpj("12.ABC.345/01DE-35", { version: 2 })).toBe(
125+
"12.ABC.345/01DE-35"
126+
);
127+
expect(formatCnpj("12OUT345000199", { version: 2 })).toBe(
128+
"12.OUT.345/0001-99"
129+
);
130+
});
119131
});

0 commit comments

Comments
 (0)