MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / setupTestFiles

Function setupTestFiles

sdk/test/ripgrep-bundling/test-ripgrep.js:14–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13// Create test files for searching
14function setupTestFiles() {
15 console.log('\n📁 Setting up test files...')
16
17 if (!existsSync(testDir)) {
18 mkdirSync(testDir, { recursive: true })
19 }
20
21 writeFileSync(
22 join(testDir, 'example.js'),
23 `
24// Test file for ripgrep search
25function testFunction() {
26 console.log('This is a test function');
27 const specialPattern = 'UNIQUE_SEARCH_TERM';
28 return specialPattern;
29}
30
31module.exports = { testFunction };
32`,
33 )
34
35 writeFileSync(
36 join(testDir, 'example.ts'),
37 `
38// TypeScript test file
39interface TestInterface {
40 name: string;
41 value: number;
42}
43
44class TestClass implements TestInterface {
45 name = 'UNIQUE_SEARCH_TERM';
46 value = 42;
47}
48
49export { TestClass };
50`,
51 )
52
53 writeFileSync(
54 join(testDir, 'config.json'),
55 `{
56 "name": "test-config",
57 "setting": "UNIQUE_SEARCH_TERM",
58 "enabled": true
59}`,
60 )
61
62 console.log('✅ Test files created')
63}
64
65// Clean up test files
66async function cleanupTestFiles() {

Callers 1

test-ripgrep.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected