-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathquery-compile.test.ts
More file actions
43 lines (36 loc) · 1.49 KB
/
query-compile.test.ts
File metadata and controls
43 lines (36 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* Tests for query-compile tool
*/
import { describe, it, expect } from 'vitest';
import { codeqlQueryCompileTool } from '../../../../src/tools/codeql/query-compile';
describe('Query Compile Tool', () => {
describe('Tool Definition', () => {
it('should have correct name', () => {
expect(codeqlQueryCompileTool.name).toBe('codeql_query_compile');
});
it('should have correct command and subcommand', () => {
expect(codeqlQueryCompileTool.command).toBe('codeql');
expect(codeqlQueryCompileTool.subcommand).toBe('query compile');
});
it('should have input schema with expected fields', () => {
const schema = codeqlQueryCompileTool.inputSchema;
expect(schema).toHaveProperty('query');
expect(schema).toHaveProperty('database');
expect(schema).toHaveProperty('dump-dil');
expect(schema).toHaveProperty('library');
expect(schema).toHaveProperty('output');
expect(schema).toHaveProperty('warnings');
expect(schema).toHaveProperty('verbose');
expect(schema).toHaveProperty('additionalArgs');
});
it('should have dump-dil as optional boolean parameter', () => {
const dumpDil = codeqlQueryCompileTool.inputSchema['dump-dil'];
expect(dumpDil).toBeDefined();
expect(dumpDil.isOptional()).toBe(true);
});
it('should have examples', () => {
expect(codeqlQueryCompileTool.examples).toBeDefined();
expect(codeqlQueryCompileTool.examples!.length).toBeGreaterThan(0);
});
});
});