File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as express from "express"
33import * as fs from "fs"
44import * as path from "path"
55import { HttpCode } from "../src/common/http"
6+ import { AuthType } from "../src/node/cli"
67import { codeServer , PluginAPI } from "../src/node/plugin"
78import * as apps from "../src/node/routes/apps"
89import * as httpserver from "./httpserver"
@@ -26,6 +27,28 @@ describe("plugin", () => {
2627
2728 const app = express . default ( )
2829 const wsApp = express . default ( )
30+
31+ const common : express . RequestHandler = ( req , _ , next ) => {
32+ // Routes might use these arguments.
33+ req . args = {
34+ _ : [ ] ,
35+ auth : AuthType . None ,
36+ host : "localhost" ,
37+ port : 8080 ,
38+ "proxy-domain" : [ ] ,
39+ config : "~/.config/code-server/config.yaml" ,
40+ verbose : false ,
41+ usingEnvPassword : false ,
42+ usingEnvHashedPassword : false ,
43+ "extensions-dir" : "" ,
44+ "user-data-dir" : "" ,
45+ }
46+ next ( )
47+ }
48+
49+ app . use ( common )
50+ wsApp . use ( common )
51+
2952 papi . mount ( app , wsApp )
3053 app . use ( "/api/applications" , apps . router ( papi ) )
3154
You can’t perform that action at this time.
0 commit comments