18 lines
658 B
TypeScript
18 lines
658 B
TypeScript
import { describe, expect, test } from 'claude-code/testing'
|
|
|
|
import { isVerifyCommand } from './verify'
|
|
|
|
describe('isVerifyCommand', () => {
|
|
test('常見的測試與 build 指令算驗證指令', () => {
|
|
for (const cmd of ['bun test', 'npm test', 'npm run test -- --watch', 'pnpm build', 'pytest -q', 'tsc -p .', 'cargo build --release', 'go test ./...', 'cd app && npm run build']) {
|
|
expect(isVerifyCommand(cmd), cmd).toBe(true)
|
|
}
|
|
})
|
|
|
|
test('其他指令不算', () => {
|
|
for (const cmd of ['grep foo src', 'ls -la', 'git status', 'cat test.txt', 'echo build', '']) {
|
|
expect(isVerifyCommand(cmd), cmd).toBe(false)
|
|
}
|
|
})
|
|
})
|