mirror of
https://github.com/coder/code-server.git
synced 2024-12-05 07:13:06 +08:00
4b4ec37880
* Add tests for relativeRoot * Remove path.posix.join Since this is for file system paths it feels incorrect to use it on URL paths as they are different in many ways. * Rewrite cookie path logic Before we relied on the client to resolve the base given to it by the backend against the path. Instead have the client pass that information along so we can resolve it on the backend. This means the client has to do less work. * Do not remove out directory before watch This is re-used for incremental compilation. Also remove del since that was the only use (and we can use fs.rmdir in the future if we need something like this). * Remove unused function resolveBase
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("./../..")
|
|
})
|
|
})
|