11import { Uri , window , workspace , WorkspaceFolder } from "vscode" ;
2- import { dump } from "js-yaml" ;
32import * as tmp from "tmp" ;
43import { join } from "path" ;
54import {
@@ -13,7 +12,6 @@ import { DirResult } from "tmp";
1312
1413import {
1514 getFirstWorkspaceFolder ,
16- getInitialQueryContents ,
1715 isFolderAlreadyInWorkspace ,
1816 prepareCodeTour ,
1917 showBinaryChoiceDialog ,
@@ -23,46 +21,10 @@ import {
2321 walkDirectory ,
2422} from "../../../src/helpers" ;
2523import { reportStreamProgress } from "../../../src/common/vscode/progress" ;
26- import { QueryLanguage } from "../../../src/common/query-language" ;
2724import { Setting } from "../../../src/config" ;
2825import { createMockCommandManager } from "../../__mocks__/commandsMock" ;
2926
3027describe ( "helpers" , ( ) => {
31- describe ( "codeql-database.yml tests" , ( ) => {
32- let dir : tmp . DirResult ;
33- let language : QueryLanguage ;
34-
35- beforeEach ( ( ) => {
36- dir = tmp . dirSync ( ) ;
37- language = QueryLanguage . Cpp ;
38-
39- const contents = dump ( {
40- primaryLanguage : language ,
41- } ) ;
42- writeFileSync ( join ( dir . name , "codeql-database.yml" ) , contents , "utf8" ) ;
43- } ) ;
44-
45- afterEach ( ( ) => {
46- dir . removeCallback ( ) ;
47- } ) ;
48-
49- it ( "should get initial query contents when language is known" , ( ) => {
50- expect ( getInitialQueryContents ( language , "hucairz" ) ) . toBe (
51- 'import cpp\n\nselect ""' ,
52- ) ;
53- } ) ;
54-
55- it ( "should get initial query contents when dbscheme is known" , ( ) => {
56- expect ( getInitialQueryContents ( "" , "semmlecode.cpp.dbscheme" ) ) . toBe (
57- 'import cpp\n\nselect ""' ,
58- ) ;
59- } ) ;
60-
61- it ( "should get initial query contents when nothing is known" , ( ) => {
62- expect ( getInitialQueryContents ( "" , "hucairz" ) ) . toBe ( 'select ""' ) ;
63- } ) ;
64- } ) ;
65-
6628 it ( "should report stream progress" , ( ) => {
6729 const progressSpy = jest . fn ( ) ;
6830 const mockReadable = {
0 commit comments