11import { expect } from 'chai' ;
22import * as path from 'path' ;
33import * as fs from 'fs-extra' ;
4- import { generateMarkdown } from '../../../../../ src/remote-queries/remote-queries-markdown-generation' ;
4+ import { generateMarkdown } from '../../../../src/remote-queries/remote-queries-markdown-generation' ;
55
66describe ( 'markdown generation' , async function ( ) {
7- it ( 'should generate markdown file for each repo with results' , async function ( ) {
8- const problemQuery = JSON . parse (
9- await fs . readFile ( path . join ( __dirname , 'data/problem-query.json' ) , 'utf8' )
7+ it ( 'for path-problem-query: should generate markdown file for each repo with results' , async function ( ) {
8+ const pathProblemQuery = JSON . parse (
9+ await fs . readFile ( path . join ( __dirname , 'data/interpreted-results/path-problem/path- problem-query.json' ) , 'utf8' )
1010 ) ;
1111
1212 const analysesResults = JSON . parse (
13- await fs . readFile ( path . join ( __dirname , 'data/analyses-results.json' ) , 'utf8' )
13+ await fs . readFile ( path . join ( __dirname , 'data/interpreted-results/path-problem/ analyses-results.json' ) , 'utf8' )
1414 ) ;
15- const markdownFiles = generateMarkdown ( problemQuery , analysesResults ) ;
15+ const markdownFiles = generateMarkdown ( pathProblemQuery , analysesResults ) ;
1616
1717 // Check that query has results for two repositories, plus a summary file
1818 expect ( markdownFiles . length ) . to . equal ( 3 ) ;
@@ -21,9 +21,9 @@ describe('markdown generation', async function() {
2121 const markdownFile1 = markdownFiles [ 1 ] ; // results for github/codeql repo
2222 const markdownFile2 = markdownFiles [ 2 ] ; // results for meteor/meteor repo
2323
24- const expectedSummaryFile = await readTestOutputFile ( 'data/summary.md' ) ;
25- const expectedTestOutput1 = await readTestOutputFile ( 'data/results-repo1.md' ) ;
26- const expectedTestOutput2 = await readTestOutputFile ( 'data/results-repo2.md' ) ;
24+ const expectedSummaryFile = await readTestOutputFile ( 'data/interpreted-results/path-problem/ summary.md' ) ;
25+ const expectedTestOutput1 = await readTestOutputFile ( 'data/interpreted-results/path-problem/ results-repo1.md' ) ;
26+ const expectedTestOutput2 = await readTestOutputFile ( 'data/interpreted-results/path-problem/ results-repo2.md' ) ;
2727
2828 // Check that markdown output is correct, after making line endings consistent
2929 expect ( markdownFile0 . join ( '\n' ) ) . to . equal ( expectedSummaryFile ) ;
0 commit comments