Reorder unit tests

This commit is contained in:
Florian Scholdei
2020-05-15 09:55:51 +02:00
parent a148d29770
commit 13a8cb4c8f

View File

@@ -28,6 +28,11 @@ const basePath = "/repo/space/name/sources/master/";
const pathname = basePath + "README.md/";
describe("correctLocalLink tests", () => {
it("should return same directory", () => {
expect(correctLocalLink(pathname, "./another.md")).toBe(basePath + "./another.md/");
expect(correctLocalLink(pathname, "./another.md#42")).toBe(basePath + "./another.md/#42");
});
it("should return same url", () => {
expect(correctLocalLink(pathname, "")).toBe(pathname);
expect(correctLocalLink(pathname, "#42")).toBe("#42");
@@ -40,13 +45,8 @@ describe("correctLocalLink tests", () => {
});
it("should return ascend directory", () => {
expect(correctLocalLink(pathname, "../")).toBe(basePath + "../"); // one layer up
expect(correctLocalLink(pathname, "../../")).toBe(basePath + "../../"); // one layer up
});
it("should return same directory", () => {
expect(correctLocalLink(pathname, "./another.md")).toBe(basePath + "./another.md/"); // same layer
expect(correctLocalLink(pathname, "./another.md#42")).toBe(basePath + "./another.md/#42"); // same layer
expect(correctLocalLink(pathname, "../")).toBe(basePath + "../");
expect(correctLocalLink(pathname, "../../")).toBe(basePath + "../../");
});
it("should return deeper links", () => {