Skip to content

Commit bf97d37

Browse files
committed
Formatting and linting fixes
1 parent 9725578 commit bf97d37

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

src/node/cli.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ export async function readConfigFile(configPath?: string): Promise<ConfigArgs> {
529529
* configPath is used as the filename in error messages
530530
*/
531531
export function parseConfigFile(configFile: string, configPath: string): ConfigArgs {
532-
if (configFile == "") {
533-
return { _: [], config: configPath }
532+
if (!configFile) {
533+
return { _: [], config: configPath }
534534
}
535535

536536
const config = yaml.safeLoad(configFile, {

test/httpserver.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class HttpServer {
6464

6565
public port(): number {
6666
const addr = this.hs.address()
67-
if (addr && typeof addr == "object") {
67+
if (addr && typeof addr === "object") {
6868
return addr.port
6969
}
7070
throw new Error("server not listening or listening on unix socket")

test/integration.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1+
import * as express from "express"
12
import { createApp } from "../src/node/app"
3+
import { parse, setDefaults, parseConfigFile, DefaultedArgs } from "../src/node/cli"
24
import { register } from "../src/node/routes"
3-
import { parse, setDefaults, parseConfigFile, DefaultedArgs } from "../src/node/cli"
45
import * as httpserver from "./httpserver"
5-
import * as express from "express"
66

7-
export async function setup(argv: string[], configFile?: string): Promise<[express.Application, express.Application, httpserver.HttpServer, DefaultedArgs]> {
7+
export async function setup(
8+
argv: string[],
9+
configFile?: string,
10+
): Promise<[express.Application, express.Application, httpserver.HttpServer, DefaultedArgs]> {
811
const cliArgs = parse(argv)
9-
let configArgs = parseConfigFile(configFile || "", "test/integration.ts")
12+
const configArgs = parseConfigFile(configFile || "", "test/integration.ts")
1013
const args = await setDefaults(cliArgs, configArgs)
1114

1215
const [app, wsApp, server] = await createApp(args)

test/proxy.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as integration from "./integration"
2-
import * as httpserver from "./httpserver"
3-
import * as express from "express"
41
import * as assert from "assert"
2+
import * as express from "express"
3+
import * as httpserver from "./httpserver"
4+
import * as integration from "./integration"
55

66
describe("proxy", () => {
77
let codeServer: httpserver.HttpServer | undefined
8-
let nhooyrDevServer = new httpserver.HttpServer()
8+
const nhooyrDevServer = new httpserver.HttpServer()
99
let proxyPath: string
1010

1111
before(async () => {
@@ -32,14 +32,14 @@ describe("proxy", () => {
3232
})
3333

3434
it("should rewrite the base path", async () => {
35-
;[,, codeServer,] = await integration.setup(["--auth=none"], "")
35+
;[, , codeServer] = await integration.setup(["--auth=none"], "")
3636
const resp = await codeServer.fetch(proxyPath)
3737
assert.equal(resp.status, 200)
3838
assert.equal(await resp.json(), "asher is the best")
3939
})
4040

4141
it("should not rewrite the base path", async () => {
42-
;[,,codeServer,] = await integration.setup(["--auth=none", "--proxy-path-passthrough=true"], "")
42+
;[, , codeServer] = await integration.setup(["--auth=none", "--proxy-path-passthrough=true"], "")
4343
const resp = await codeServer.fetch(proxyPath)
4444
assert.equal(resp.status, 200)
4545
assert.equal(await resp.json(), "joe is the best")

0 commit comments

Comments
 (0)