Browse Source

Fix unit test tooling

Michaël Lemaire 4 months ago
parent
commit
8484e749d8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      cli.test.ts

+ 3 - 2
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");
   });
 });