surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| 1 | import { describe, expect, test, tier } from 'claude-code/testing' |
| 2 | |
| 3 | import Classify from '../../hooks/classify' |
| 4 | |
| 5 | tier('builtin') |
| 6 | |
| 7 | describe('is-noise-file', () => { |
| 8 | test('tests, fixtures and snapshots are noise', () => { |
| 9 | for (const path of [ |
| 10 | 'test/a.ts', |
| 11 | 'src/x/__tests__/y.ts', |
| 12 | 'lib/foo.test.tsx', |
| 13 | 'pkg/bar_test.go', |
| 14 | 'web/fixtures/data.json', |
| 15 | 'ui/__snapshots__/a.snap', |
| 16 | ]) { |
| 17 | expect(Classify.isNoiseFile(path), path).toBe(true) |
| 18 | } |
| 19 | }) |
| 20 | |
| 21 | test('lockfiles, builds, minified and generated files are noise', () => { |
| 22 | for (const path of [ |
| 23 | 'bun.lock', |
| 24 | 'package-lock.json', |
| 25 | 'dist/index.js', |
| 26 | 'assets/app.min.js', |
| 27 | 'types/api.d.ts', |
| 28 | 'src/constants/prompts.generated/x.ts', |
| 29 | 'proto/service.pb.go', |
| 30 | ]) { |
| 31 | expect(Classify.isNoiseFile(path), path).toBe(true) |
| 32 | } |
| 33 | }) |
| 34 | |
| 35 | test('source is not, even with test inside a longer word', () => { |
| 36 | for (const path of ['src/contest/entry.ts', 'src/latest.ts', 'README.md']) { |
| 37 | expect(Classify.isNoiseFile(path), path).toBe(false) |
| 38 | } |
| 39 | }) |
| 40 | }) |