Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/tangled-cli. Automation-first CLI for Tangled.org
Something went wrong. Try again.
1.0 kB · 32 lines
TypeScript
123456789101112131415161718192021222324252627282930313233import { execSync } from 'node:child_process';import { readFileSync } from 'node:fs';import { dirname, join } from 'node:path';import { fileURLToPath } from 'node:url';import { describe, expect, it } from 'vitest';
const __filename = fileURLToPath(import.meta.url);const __dirname = dirname(__filename);const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
describe('Tangled CLI', () => { it('should display version', () => { const output = execSync('npx tsx src/index.ts --version', { encoding: 'utf-8', cwd: join(__dirname, '..'), }); expect(output.trim()).toBe(packageJson.version); });
it('should display help', () => { const output = execSync('npx tsx src/index.ts --help', { encoding: 'utf-8', cwd: join(__dirname, '..'), }); expect(output).toContain('A CLI for Tangled.org'); expect(output).toContain('Usage:'); });
it('package.json should have correct name', () => { expect(packageJson.name).toBe('tangled-cli'); });});