Skip to content

Commit e09359a

Browse files
committed
chore: add ts-ignore in test plugin
1 parent fa62975 commit e09359a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/unit/test-plugin/src/index.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1+
// @ts-ignore: this is a virtual module which we mock in the test so it doesn't exist when tsc runs
12
import * as cs from "code-server"
23
import * as fspath from "path"
34

5+
type FixMeLater = any
6+
47
export const plugin: cs.Plugin = {
58
displayName: "Test Plugin",
69
routerPath: "/test-plugin",
710
homepageURL: "https://example.com",
811
description: "Plugin used in code-server tests.",
912

10-
init(config) {
13+
init(config: FixMeLater) {
1114
config.logger.debug("test-plugin loaded!")
1215
},
1316

1417
router() {
1518
const r = cs.express.Router()
16-
r.get("/test-app", (_, res) => {
19+
r.get("/test-app", (_: FixMeLater, res: FixMeLater) => {
1720
res.sendFile(fspath.resolve(__dirname, "../public/index.html"))
1821
})
19-
r.get("/goland/icon.svg", (_, res) => {
22+
r.get("/goland/icon.svg", (_: FixMeLater, res: FixMeLater) => {
2023
res.sendFile(fspath.resolve(__dirname, "../public/icon.svg"))
2124
})
2225
r.get("/error", () => {
@@ -27,8 +30,8 @@ export const plugin: cs.Plugin = {
2730

2831
wsRouter() {
2932
const wr = cs.WsRouter()
30-
wr.ws("/test-app", (req) => {
31-
cs.wss.handleUpgrade(req, req.ws, req.head, (ws) => {
33+
wr.ws("/test-app", (req: FixMeLater) => {
34+
cs.wss.handleUpgrade(req, req.ws, req.head, (ws: FixMeLater) => {
3235
req.ws.resume()
3336
ws.send("hello")
3437
})

0 commit comments

Comments
 (0)