refactor: remove dead code (#5188)
* refactor: delete unused code
* refactor: move onLine to test helpers
* Revert "refactor: move onLine to test helpers"
This reverts commit 32cc27b213
.
* fixup! refactor: delete unused code
This commit is contained in:
@ -24,16 +24,6 @@ describe("util", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("split", () => {
|
||||
it("should split at a comma", () => {
|
||||
expect(util.split("Hello,world", ",")).toStrictEqual(["Hello", "world"])
|
||||
})
|
||||
|
||||
it("shouldn't split if the delimiter doesn't exist", () => {
|
||||
expect(util.split("Hello world", ",")).toStrictEqual(["Hello world", ""])
|
||||
})
|
||||
})
|
||||
|
||||
describe("plural", () => {
|
||||
it("should add an s if count is greater than 1", () => {
|
||||
expect(util.plural(2, "dog")).toBe("dogs")
|
||||
@ -57,43 +47,6 @@ describe("util", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("trimSlashes", () => {
|
||||
it("should remove leading slashes", () => {
|
||||
expect(util.trimSlashes("/hello-world")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove trailing slashes", () => {
|
||||
expect(util.trimSlashes("hello-world/")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove both leading and trailing slashes", () => {
|
||||
expect(util.trimSlashes("/hello-world/")).toBe("hello-world")
|
||||
})
|
||||
|
||||
it("should remove multiple leading and trailing slashes", () => {
|
||||
expect(util.trimSlashes("///hello-world////")).toBe("hello-world")
|
||||
})
|
||||
})
|
||||
|
||||
describe("arrayify", () => {
|
||||
it("should return value it's already an array", () => {
|
||||
expect(util.arrayify(["hello", "world"])).toStrictEqual(["hello", "world"])
|
||||
})
|
||||
|
||||
it("should wrap the value in an array if not an array", () => {
|
||||
expect(
|
||||
util.arrayify({
|
||||
name: "Coder",
|
||||
version: "3.8",
|
||||
}),
|
||||
).toStrictEqual([{ name: "Coder", version: "3.8" }])
|
||||
})
|
||||
|
||||
it("should return an empty array if the value is undefined", () => {
|
||||
expect(util.arrayify(undefined)).toStrictEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
describe("logError", () => {
|
||||
beforeAll(() => {
|
||||
mockLogger()
|
||||
|
Reference in New Issue
Block a user