Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/integration.ts

17 lines
736 B
TypeScript

import { createApp } from "../src/node/app"
import { register } from "../src/node/routes"
import { parse, setDefaults, parseConfigFile, DefaultedArgs } from "../src/node/cli"
import * as httpserver from "./httpserver"
import * as express from "express"
export async function setup(argv: string[], configFile?: string): Promise<[express.Application, express.Application, httpserver.HttpServer, DefaultedArgs]> {
const cliArgs = parse(argv)
let configArgs = parseConfigFile(configFile || "", "test/integration.ts")
const args = await setDefaults(cliArgs, configArgs)
const [app, wsApp, server] = await createApp(args)
await register(app, wsApp, server, args)
return [app, wsApp, new httpserver.HttpServer(server), args]
}