CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/util/jupyter-api/chdir-commands.test.ts
Views: 687
1
import cdcmd from "./chdir-commands";
2
3
describe("chdir-commands", () => {
4
test("bash", () => {
5
expect(cdcmd("bash", "/home/")).toBe("cd '/home/'");
6
expect(cdcmd("bash", "/home/foo'bar")).toBe("cd '/home/foo\\'bar'");
7
});
8
9
test("python", () => {
10
expect(cdcmd("python", "/home/")).toBe("import os; os.chdir('/home/')");
11
expect(cdcmd("python", "/home/foo'bar")).toBe(
12
"import os; os.chdir('/home/foo\\'bar')"
13
);
14
});
15
});
16
17