mirror of
https://github.com/coder/code-server.git
synced 2024-12-04 15:00:38 +08:00
12 lines
429 B
TypeScript
12 lines
429 B
TypeScript
|
import { relativeRoot } from "../../../src/node/http"
|
||
|
|
||
|
describe("http", () => {
|
||
|
it("should construct a relative path to the root", () => {
|
||
|
expect(relativeRoot("/")).toStrictEqual(".")
|
||
|
expect(relativeRoot("/foo")).toStrictEqual(".")
|
||
|
expect(relativeRoot("/foo/")).toStrictEqual("./..")
|
||
|
expect(relativeRoot("/foo/bar ")).toStrictEqual("./..")
|
||
|
expect(relativeRoot("/foo/bar/")).toStrictEqual("./../..")
|
||
|
})
|
||
|
})
|