(argv: string[], configFile?: string)
| 7 | import * as httpserver from "./httpserver" |
| 8 | |
| 9 | export async function setup(argv: string[], configFile?: string): Promise<httpserver.HttpServer> { |
| 10 | // This will be used as the data directory to ensure instances do not bleed |
| 11 | // into each other. |
| 12 | const dir = await tmpdir(workspaceDir) |
| 13 | |
| 14 | // VS Code complains if the logs dir is missing which spams the output. |
| 15 | // TODO: Does that mean we are not creating it when we should be? |
| 16 | await fs.mkdir(path.join(dir, "logs")) |
| 17 | |
| 18 | const cliArgs = parse([ |
| 19 | `--config=${path.join(dir, "config.yaml")}`, |
| 20 | `--user-data-dir=${dir}`, |
| 21 | "--bind-addr=localhost:0", |
| 22 | "--log=warn", |
| 23 | ...argv, |
| 24 | ]) |
| 25 | const configArgs = parseConfigFile(configFile || "", "test/integration.ts") |
| 26 | const args = await setDefaults(cliArgs, configArgs) |
| 27 | |
| 28 | const server = await runCodeServer(args) |
| 29 | |
| 30 | return new httpserver.HttpServer(server) |
| 31 | } |
nothing calls this directly
no test coverage detected