Archived
1
0
This repository has been archived on 2024-09-09. You can view files and clone it, but cannot push or open issues or pull requests.
code-server/test/util.test.ts
2021-01-21 10:10:32 -07:00

19 lines
524 B
TypeScript

import { normalize } from "../src/common/util"
describe("util", () => {
describe("normalize", () => {
it("should remove multiple slashes", () => {
expect(normalize("//foo//bar//baz///mumble")).toBe("/foo/bar/baz/mumble")
})
it("should remove trailing slashes", () => {
expect(normalize("qux///")).toBe("qux")
})
it("should preserve trailing slash if it exists", () => {
expect(normalize("qux///", true)).toBe("qux/")
expect(normalize("qux", true)).toBe("qux")
})
})
})