diff --git a/package.json b/package.json index 67d7e14..4144b5e 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,13 @@ }, "engines": { "node": ">=20" - } + }, + "repository": { + "type": "git", + "url": "https://github.com/rogerchappel/clipcase" + }, + "bugs": { + "url": "https://github.com/rogerchappel/clipcase/issues" + }, + "homepage": "https://github.com/rogerchappel/clipcase#readme" } diff --git a/test/cli.test.ts b/test/cli.test.ts new file mode 100644 index 0000000..bceafb5 --- /dev/null +++ b/test/cli.test.ts @@ -0,0 +1,22 @@ +import { describe, it } from 'node:test'; +import assert from 'node:assert'; +import { execFileSync } from 'node:child_process'; + +describe('clipcase CLI', () => { + it('should list all case formats', () => { + const out = execFileSync(process.execPath, ['dist/src/cli.js', 'list'], { encoding: 'utf8' }); + assert.ok(out.includes('camel') || out.includes('snake') || out.includes('kebab'), + 'list should show case formats'); + }); + + it('should convert between case formats', () => { + const out = execFileSync(process.execPath, ['dist/src/cli.js', 'convert', 'helloWorld', 'snake'], { encoding: 'utf8' }); + assert.ok(out.includes('hello_world'), 'should convert camelCase to snake_case'); + }); + + it('should detect case format', () => { + const out = execFileSync(process.execPath, ['dist/src/cli.js', 'detect', 'hello-world'], { encoding: 'utf8' }); + assert.ok(out.includes('kebab') || out.includes('dash') || out.includes('kebab-case'), + 'should detect kebab-case'); + }); +});