diff --git a/test/cli.test.ts b/test/cli.test.ts index d76fe83..6e30c36 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -17,6 +17,20 @@ afterEach(async () => { }); describe("cli", () => { + it("builds an importable library and an executable CLI with one shebang", async () => { + await execa("npm", ["run", "build"]); + + const [library, cli, result] = await Promise.all([ + readFile("dist/index.js", "utf8"), + readFile("dist/cli/index.js", "utf8"), + execa("node", ["dist/cli/index.js", "--help"]), + ]); + + expect(library.startsWith("#!")).toBe(false); + expect(cli.match(/^#!/gm)).toHaveLength(1); + expect(result.stdout).toContain("Render Markdown documents to PDF."); + }, 30_000); + it("renders a Markdown file to the requested PDF path", async () => { const workspace = await createWorkspace(); const inputPath = join(workspace, "notes.md"); diff --git a/tsup.config.ts b/tsup.config.ts index d9b1558..028672f 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -8,7 +8,4 @@ export default defineConfig({ clean: true, splitting: false, target: "node20", - banner: { - js: "#!/usr/bin/env node", - }, });