Files
30-seconds-of-code/node_modules/kebab-hash/lib/index.test.js.flow
2019-08-20 15:52:05 +02:00

22 lines
527 B
Plaintext

import kebabHash from "./index";
describe("Default hashLength", () => {
test("Returns for /foo-bar", () => {
expect(kebabHash("/foo-bar")).toBe("foo-bar-096");
});
test("Returns for /foo/bar", () => {
expect(kebabHash("/foo/bar")).toBe("foo-bar-1df");
});
});
describe("hashLength 5", () => {
test("Returns for /foo-bar", () => {
expect(kebabHash("/foo-bar", 5)).toBe("foo-bar-09652");
});
test("Returns for /foo/bar", () => {
expect(kebabHash("/foo/bar", 5)).toBe("foo-bar-1df48");
});
});