Tool to run software, backing up data at a remote site
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
495 B

import {
expect,
it,
patch,
} 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", (mock) => {
mock.stub(() => "/home/user");
expect(makeAbsolute("~/test", "/tmp")).toEqual("/home/user/test");
});
});