mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 03:55:18 +02:00
feat: setup jest
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
import * as assert from "assert"
|
||||
import { normalize } from "../src/common/util"
|
||||
|
||||
describe("util", () => {
|
||||
describe("normalize", () => {
|
||||
it("should remove multiple slashes", () => {
|
||||
assert.equal(normalize("//foo//bar//baz///mumble"), "/foo/bar/baz/mumble")
|
||||
expect(normalize("//foo//bar//baz///mumble")).toBe("/foo/bar/baz/mumble")
|
||||
})
|
||||
|
||||
it("should remove trailing slashes", () => {
|
||||
assert.equal(normalize("qux///"), "qux")
|
||||
expect(normalize("qux///")).toBe("qux")
|
||||
})
|
||||
|
||||
it("should preserve trailing slash if it exists", () => {
|
||||
assert.equal(normalize("qux///", true), "qux/")
|
||||
assert.equal(normalize("qux", true), "qux")
|
||||
expect(normalize("qux///", true)).toBe("qux/")
|
||||
expect(normalize("qux", true)).toBe("qux")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user