Skip to content

Commit 2b98406

Browse files
committed
Add test
1 parent bea4963 commit 2b98406

File tree

2 files changed

+498
-0
lines changed

2 files changed

+498
-0
lines changed

test/bin/cli.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ describe("cli", () => {
3434
expect(generated.toString("utf8")).to.equal(expected);
3535
});
3636

37+
it("stdin", async () => {
38+
execSync(`${cmd} - -o generated/stdin.ts < ./specs/petstore.yaml`, {
39+
cwd,
40+
});
41+
const generated = fs.readFileSync(new URL("./generated/stdin.ts", cwd), "utf8");
42+
const expected = eol.lf(fs.readFileSync(new URL("./expected/stdin.ts", cwd), "utf8"));
43+
expect(generated).to.equal(expected);
44+
});
45+
3746
it("supports glob paths", async () => {
3847
execSync(`${cmd} "specs/*.yaml" -o generated/`, { cwd }); // Quotes are necessary because shells like zsh treats glob weirdly
3948
const generatedPetstore = fs.readFileSync(new URL("./generated/specs/petstore.ts", cwd), "utf8");

0 commit comments

Comments
 (0)