@@ -24,6 +24,23 @@ describe('run-queries', () => {
2424 expect ( info . dataset ) . to . eq ( 'file:///abc' ) ;
2525 } ) ;
2626
27+ it ( 'should check if interpreted results can be created' , async ( ) => {
28+ const info = createMockQueryInfo ( ) ;
29+ ( info . dbItem . hasMetadataFile as sinon . SinonStub ) . returns ( true ) ;
30+
31+ expect ( await info . canHaveInterpretedResults ( ) ) . to . eq ( true ) ;
32+
33+ ( info . dbItem . hasMetadataFile as sinon . SinonStub ) . returns ( false ) ;
34+ expect ( await info . canHaveInterpretedResults ( ) ) . to . eq ( false ) ;
35+
36+ ( info . dbItem . hasMetadataFile as sinon . SinonStub ) . returns ( true ) ;
37+ info . metadata ! . kind = undefined ;
38+ expect ( await info . canHaveInterpretedResults ( ) ) . to . eq ( false ) ;
39+
40+ info . metadata ! . kind = 'table' ;
41+ expect ( await info . canHaveInterpretedResults ( ) ) . to . eq ( false ) ;
42+ } ) ;
43+
2744 describe ( 'compile' , ( ) => {
2845 it ( 'should compile' , async ( ) => {
2946 const info = createMockQueryInfo ( ) ;
@@ -73,9 +90,14 @@ describe('run-queries', () => {
7390 {
7491 contents : {
7592 datasetUri : 'file:///abc'
76- }
93+ } ,
94+ hasMetadataFile : sinon . stub ( )
7795 } as unknown as DatabaseItem ,
78- 'my-scheme' // queryDbscheme
96+ 'my-scheme' , // queryDbscheme,
97+ undefined ,
98+ {
99+ kind : 'problem'
100+ }
79101 ) ;
80102 }
81103
0 commit comments