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

19 lines
524 B
TypeScript
Raw Normal View History

2020-02-05 01:16:45 +01:00
import { normalize } from "../src/common/util"
2020-02-04 20:27:46 +01:00
describe("util", () => {
describe("normalize", () => {
it("should remove multiple slashes", () => {
2021-01-08 21:55:47 +01:00
expect(normalize("//foo//bar//baz///mumble")).toBe("/foo/bar/baz/mumble")
2020-02-04 20:27:46 +01:00
})
it("should remove trailing slashes", () => {
2021-01-08 21:55:47 +01:00
expect(normalize("qux///")).toBe("qux")
2020-02-04 20:27:46 +01:00
})
2020-02-05 01:16:45 +01:00
it("should preserve trailing slash if it exists", () => {
2021-01-08 21:55:47 +01:00
expect(normalize("qux///", true)).toBe("qux/")
expect(normalize("qux", true)).toBe("qux")
2020-02-05 01:16:45 +01:00
})
2020-02-04 20:27:46 +01:00
})
})