Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c06646

Browse files
committed
Formatting and linting fixes
1 parent 60233d0 commit 5c06646

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

‎src/node/cli.ts‎

Lines changed: 2 additions & 2 deletions
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‎

Lines changed: 1 addition & 1 deletion
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‎

Lines changed: 7 additions & 4 deletions
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‎

Lines changed: 6 additions & 6 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /