mirror of
https://github.com/coder/code-server.git
synced 2024-12-05 07:13:06 +08:00
3e1c00e017
Not sure why CI missed these, will have to look into it.
31 lines
766 B
TypeScript
31 lines
766 B
TypeScript
import { mockLogger } from "../../../utils/helpers"
|
|
import * as httpserver from "../../../utils/httpserver"
|
|
import * as integration from "../../../utils/integration"
|
|
|
|
describe("vscode", () => {
|
|
let codeServer: httpserver.HttpServer | undefined
|
|
beforeEach(() => {
|
|
mockLogger()
|
|
})
|
|
|
|
afterEach(async () => {
|
|
if (codeServer) {
|
|
await codeServer.dispose()
|
|
codeServer = undefined
|
|
}
|
|
jest.clearAllMocks()
|
|
})
|
|
|
|
it("should fail origin check", async () => {
|
|
await expect(async () => {
|
|
codeServer = await integration.setup(["--auth=none"], "")
|
|
await codeServer.wsWait("/vscode", {
|
|
headers: {
|
|
host: "localhost:8080",
|
|
origin: "https://evil.org",
|
|
},
|
|
})
|
|
}).rejects.toThrow()
|
|
})
|
|
})
|