@@ -3,18 +3,12 @@ import { resolve } from "path";
33import type { TextDocument } from "vscode" ;
44import { authentication , commands , window , workspace } from "vscode" ;
55
6- import { MockGitHubApiServer } from "../../../../src/common/mock-gh-api/mock-gh-api-server" ;
76import { mockedQuickPickItem } from "../../utils/mocking.helpers" ;
87import { setRemoteControllerRepo } from "../../../../src/config" ;
98import { getActivatedExtension } from "../../global.helper" ;
109import { createVSCodeCommandManager } from "../../../../src/common/vscode/commands" ;
1110import type { AllCommands } from "../../../../src/common/commands" ;
1211
13- const mockServer = new MockGitHubApiServer ( ) ;
14- beforeAll ( ( ) => mockServer . startServer ( "bypass" ) ) ;
15- afterEach ( ( ) => mockServer . unloadScenario ( ) ) ;
16- afterAll ( ( ) => mockServer . stopServer ( ) ) ;
17-
1812async function showQlDocument ( name : string ) : Promise < TextDocument > {
1913 const folderPath = workspace . workspaceFolders ! [ 0 ] . uri . fsPath ;
2014 const documentPath = resolve ( folderPath , name ) ;
@@ -24,7 +18,7 @@ async function showQlDocument(name: string): Promise<TextDocument> {
2418}
2519
2620// MSW can't intercept fetch requests made in VS Code, so we are skipping these tests for now
27- describe . skip ( "Variant Analysis Submission Integration" , ( ) => {
21+ describe ( "Variant Analysis Submission Integration" , ( ) => {
2822 const commandManager = createVSCodeCommandManager < AllCommands > ( ) ;
2923 let quickPickSpy : jest . SpiedFunction < typeof window . showQuickPick > ;
3024 let executeCommandSpy : jest . SpiedFunction < typeof commands . executeCommand > ;
@@ -54,9 +48,16 @@ describe.skip("Variant Analysis Submission Integration", () => {
5448 await getActivatedExtension ( ) ;
5549 } ) ;
5650
51+ afterAll ( async ( ) => {
52+ await commandManager . execute ( "codeQL.mockGitHubApiServer.unloadScenario" ) ;
53+ } ) ;
54+
5755 describe ( "Successful scenario" , ( ) => {
5856 beforeEach ( async ( ) => {
59- await mockServer . loadScenario ( "mrva-problem-query-success" ) ;
57+ await commandManager . execute (
58+ "codeQL.mockGitHubApiServer.loadScenario" ,
59+ "mrva-problem-query-success" ,
60+ ) ;
6061 } ) ;
6162
6263 it ( "opens the variant analysis view" , async ( ) => {
@@ -81,7 +82,10 @@ describe.skip("Variant Analysis Submission Integration", () => {
8182
8283 describe ( "Missing controller repo" , ( ) => {
8384 beforeEach ( async ( ) => {
84- await mockServer . loadScenario ( "mrva-missing-controller-repo" ) ;
85+ await commandManager . execute (
86+ "codeQL.mockGitHubApiServer.loadScenario" ,
87+ "mrva-missing-controller-repo" ,
88+ ) ;
8589 } ) ;
8690
8791 it ( "shows the error message" , async ( ) => {
@@ -108,7 +112,10 @@ describe.skip("Variant Analysis Submission Integration", () => {
108112
109113 describe ( "Submission failure" , ( ) => {
110114 beforeEach ( async ( ) => {
111- await mockServer . loadScenario ( "mrva-submission-failure" ) ;
115+ await commandManager . execute (
116+ "codeQL.mockGitHubApiServer.loadScenario" ,
117+ "mrva-submission-failure" ,
118+ ) ;
112119 } ) ;
113120
114121 it ( "shows the error message" , async ( ) => {
0 commit comments