mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-28 21:25:25 +00: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("./../..")
|
||
|
})
|
||
|
})
|