Merged 2.0.0-m3

This commit is contained in:
Philipp Czora
2018-10-19 08:44:03 +02:00
27 changed files with 1002 additions and 229 deletions

View File

@@ -1,5 +1,27 @@
// @flow
import { getPageFromMatch } from "./urls";
import {concat, getPageFromMatch, withEndingSlash} from "./urls";
describe("tests for withEndingSlash", () => {
it("should append missing slash", () => {
expect(withEndingSlash("abc")).toBe("abc/");
});
it("should not append a second slash", () => {
expect(withEndingSlash("abc/")).toBe("abc/");
});
});
describe("concat tests", () => {
it("should concat the parts to a single url", () => {
expect(concat("a")).toBe("a");
expect(concat("a", "b")).toBe("a/b");
expect(concat("a", "b", "c")).toBe("a/b/c");
});
});
describe("tests for getPageFromMatch", () => {
function createMatch(page: string) {