@ideascol/cli-maker
Version:
A simple library to help create CLIs
5 lines (4 loc) • 2.19 kB
TypeScript
export declare const testCliBun = "import { describe, test, expect } from \"bun:test\";\n\nimport { cli } from '../../cli';\n\ndescribe(\"CLI\", () => {\n test(\"Validate CLI default params\", () => {\n expect(cli.getName()).toBe(\"{{cliName}}\");\n expect(cli.getDescription()).toBe(\"{{cliDescription}}\");\n expect(cli.getCommands().length).toBe(1);\n expect(cli.getOptions()?.interactive).toBe(true);\n expect(cli.getOptions()?.version).toBe(\"1.0.0\");\n });\n\n test(\"required params for first command\", () => {\n const firstCommand = cli.getCommands()[0];\n\n expect(cli.getCommands().length).toBe(1);\n expect(firstCommand.params.length).toBe(1);\n expect(firstCommand.params[0].required).toBe(true);\n });\n});\n";
export declare const testCliNpm = "import { describe, it } from \"node:test\";\nimport { strict as assert } from \"node:assert\";\n\nimport { cli } from '../../cli';\n\ndescribe(\"CLI\", () => {\n it(\"Validate CLI default params\", () => {\n assert.equal(cli.getName(), \"{{cliName}}\");\n assert.equal(cli.getDescription(), \"{{cliDescription}}\");\n assert.equal(cli.getCommands().length, 1);\n assert.equal(cli.getOptions()?.interactive, true);\n assert.equal(cli.getOptions()?.version, \"1.0.0\");\n });\n\n it(\"required params for first command\", () => {\n const firstCommand = cli.getCommands()[0];\n\n assert.equal(cli.getCommands().length, 1);\n assert.equal(firstCommand.params.length, 1);\n assert.equal(firstCommand.params[0].required, true);\n });\n});\n\n";
export declare const testLibBun = "import { describe, test, expect } from \"bun:test\";\n\nimport { Greet } from '../../lib';\n\ndescribe(\"Lib\", () => {\n test(\"should return the message\", () => {\n const message = Greet('John');\n expect(message).toBe('Hello, John!');\n });\n});\n";
export declare const testLibNpm = "import { describe, it } from \"node:test\";\nimport { strict as assert } from \"node:assert\";\n\nimport { Greet } from '../../lib';\n\ndescribe(\"Lib\", () => {\n it(\"should return the message\", () => {\n const message = Greet('John');\n assert.equal(message, 'Hello, John!');\n });\n});";