Skip to content

Commit cc907d2

Browse files
Add test for exportResultsToGist method
While we're here we're also adding a test for the `exportResultsToGist` method, as there were no tests for the `export-results.ts` file. We initially attempted to add the test to the pure-tests folder, but the `export-results.ts` file imports some components from `vscode`, which meant we needed to set up the test in an environment where VSCode dependencies are available. We chose to add the test to `vscode-tests/no-workspace` for convenience, as there are already other unit tests there. We've also had to import our own query and analysis result to be able to work with data closer to reality for exported results. Since we've introduced functionality to build a gist title, let's check that the `exportResultsToGist` method will forward the correct title to the GitHub Actions API. Co-authored-by: Shati Patel <shati-patel@github.com>
1 parent c4df9db commit cc907d2

File tree

4 files changed

+529
-1
lines changed

4 files changed

+529
-1
lines changed

extensions/ql-vscode/src/remote-queries/export-results.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async function determineExportFormat(
7474
/**
7575
* Converts the results of a remote query to markdown and uploads the files as a secret gist.
7676
*/
77-
async function exportResultsToGist(
77+
export async function exportResultsToGist(
7878
ctx: ExtensionContext,
7979
query: RemoteQuery,
8080
analysesResults: AnalysisResults[]

0 commit comments

Comments
 (0)