Skip to content

Commit 7dc85f9

Browse files
committed
chore: simplify mocha usage in als
Prepares for switching to vitest
1 parent 13a2e1b commit 7dc85f9

File tree

3 files changed

+12
-95
lines changed

3 files changed

+12
-95
lines changed

packages/ansible-language-server/test/consoleOutput.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,21 @@
1-
import * as chai from "chai";
2-
import { ConsoleOutput } from "./consoleOutput";
3-
import { skipEE, console, deleteAlsCache } from "./helper";
4-
5-
chai.config.truncateThreshold = 0; // disable truncating
1+
import { deleteAlsCache } from "./helper";
62

73
export const mochaHooks = (): Mocha.RootHookObject => {
8-
const consoleOutput = new ConsoleOutput();
94

105
return {
116
beforeAll(this: Mocha.Context) {
127
deleteAlsCache();
138
},
14-
beforeEach(this: Mocha.Context) {
15-
if (skipEE() && this.currentTest?.fullTitle().includes("@ee")) {
16-
console.warn(
17-
`Skipped test due to environment conditions: ${this.currentTest.title}`,
18-
);
19-
this.skip();
20-
} else {
21-
consoleOutput.capture();
22-
}
23-
},
24-
25-
afterEach(this: Mocha.Context) {
26-
if (!(skipEE() && this.currentTest?.fullTitle().includes("@ee"))) {
27-
if (this.currentTest?.state !== "passed") {
28-
consoleOutput.release();
29-
}
30-
}
31-
},
32-
afterAll(this: Mocha.Context) {
33-
deleteAlsCache();
34-
},
9+
// beforeEach(this: Mocha.Context) {
10+
// if (skipEE() && this.currentTest?.fullTitle().includes("@ee")) {
11+
// console.warn(
12+
// `Skipped test due to environment conditions: ${this.currentTest.title}`,
13+
// );
14+
// this.skip();
15+
// }
16+
// },
17+
// afterAll(this: Mocha.Context) {
18+
// deleteAlsCache();
19+
// },
3520
};
3621
};

tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"src/**/*.ts",
1616
"webviews/lightspeed/src/utils/*.ts",
1717
"test",
18-
"packages/*/test/consoleOutput.ts",
1918
"*.js",
2019
"*.ts"
2120
],

0 commit comments

Comments
 (0)