Skip to content

Commit 1186026

Browse files
author
Dave Bartolomeo
committed
Remove old unit tests
1 parent 2ba23ce commit 1186026

1 file changed

Lines changed: 1 addition & 51 deletions

File tree

extensions/ql-vscode/test/vscode-tests/no-workspace/query-testing/test-adapter.test.ts

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import type {
2-
TestItem,
3-
TestItemCollection,
4-
TestRun,
5-
WorkspaceFolder,
6-
} from "vscode";
1+
import type { TestItem, TestItemCollection, TestRun } from "vscode";
72
import {
83
CancellationTokenSource,
94
Range,
@@ -12,7 +7,6 @@ import {
127
tests,
138
} from "vscode";
149

15-
import { QLTestAdapter } from "../../../../src/query-testing/test-adapter";
1610
import type { CodeQLCliServer } from "../../../../src/codeql-cli/cli";
1711
import type { DatabaseManager } from "../../../../src/databases/local-databases";
1812
import { mockedObject } from "../../utils/mocking.helpers";
@@ -41,50 +35,6 @@ describe("test-adapter", () => {
4135
testRunner = new TestRunner(fakeDatabaseManager, fakeCliServer);
4236
});
4337

44-
it("legacy test adapter should run some tests", async () => {
45-
const adapter = new QLTestAdapter(
46-
mockedObject<WorkspaceFolder>({
47-
name: "ABC",
48-
uri: Uri.parse("file:/ab/c"),
49-
}),
50-
testRunner,
51-
fakeCliServer,
52-
);
53-
54-
const listenerSpy = jest.fn();
55-
adapter.testStates(listenerSpy);
56-
await adapter.run([mockTestsInfo.testsPath]);
57-
58-
expect(listenerSpy).toBeCalledTimes(5);
59-
60-
expect(listenerSpy).toHaveBeenNthCalledWith(1, {
61-
type: "started",
62-
tests: [mockTestsInfo.testsPath],
63-
});
64-
expect(listenerSpy).toHaveBeenNthCalledWith(2, {
65-
type: "test",
66-
state: "passed",
67-
test: mockTestsInfo.dPath,
68-
message: undefined,
69-
decorations: [],
70-
});
71-
expect(listenerSpy).toHaveBeenNthCalledWith(3, {
72-
type: "test",
73-
state: "errored",
74-
test: mockTestsInfo.gPath,
75-
message: `\ncompilation error: ${mockTestsInfo.gPath}\nERROR: abc\n`,
76-
decorations: [{ line: 1, message: "abc" }],
77-
});
78-
expect(listenerSpy).toHaveBeenNthCalledWith(4, {
79-
type: "test",
80-
state: "failed",
81-
test: mockTestsInfo.hPath,
82-
message: `\nfailed: ${mockTestsInfo.hPath}\njkh\ntuv\n`,
83-
decorations: [],
84-
});
85-
expect(listenerSpy).toHaveBeenNthCalledWith(5, { type: "finished" });
86-
});
87-
8838
it("native test manager should run some tests", async () => {
8939
const enqueuedSpy = jest.fn();
9040
const passedSpy = jest.fn();

0 commit comments

Comments
 (0)