Browse Source

Fix unit test tooling

master
Michaël Lemaire 10 months ago
parent
commit
8484e749d8
  1. 5
      cli.test.ts

5
cli.test.ts

@ -2,13 +2,14 @@ import {
expect,
it,
patch,
} from "https://code.thunderk.net/typescript/devtools/raw/1.1.2/testing.ts";
} from "https://code.thunderk.net/typescript/devtools/raw/1.2.2/testing.ts";
import { makeAbsolute, System } from "./cli.ts";
it("makes paths absolute", () => {
expect(makeAbsolute("test", "/home/user")).toEqual("/home/user/test");
expect(makeAbsolute("/srv/test", "/home/user")).toEqual("/srv/test");
patch(System, "getenv", () => "/home/user").exec(() => {
patch(System, "getenv", (mock) => {
mock.stub(() => "/home/user");
expect(makeAbsolute("~/test", "/tmp")).toEqual("/home/user/test");
});
});

Loading…
Cancel
Save