mirror of
https://github.com/coder/code-server.git
synced 2026-05-06 12:31:58 +02:00
test: Implement integration.ts for near full stack integration testing
This commit is contained in:
16
test/integration.ts
Normal file
16
test/integration.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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]
|
||||
}
|
||||
Reference in New Issue
Block a user