mirror of
https://github.com/coder/code-server.git
synced 2024-12-04 23:03:06 +08:00
e597d49912
- Move the old data directory if possible. - Fix extension path to not use a hard-coded path and instead use the data directory. - Create every part of the path during startup. - Create each path when a connection is made as well in case they are deleted while the server is running. - Create every part of the path before saving settings or writing a file using the resource endpoint.
24 lines
657 B
TypeScript
24 lines
657 B
TypeScript
import { createClient } from "./helpers";
|
|
|
|
describe("Server", () => {
|
|
const dataDirectory = "/tmp/example";
|
|
const workingDirectory = "/working/dir";
|
|
const builtInExtensionsDirectory = "/tmp/example";
|
|
const cacheDirectory = "/tmp/cache";
|
|
const client = createClient({
|
|
builtInExtensionsDirectory,
|
|
cacheDirectory,
|
|
dataDirectory,
|
|
workingDirectory,
|
|
});
|
|
|
|
it("should get init msg", (done) => {
|
|
client.initData.then((data) => {
|
|
expect(data.dataDirectory).toEqual(dataDirectory);
|
|
expect(data.workingDirectory).toEqual(workingDirectory);
|
|
expect(data.builtInExtensionsDirectory).toEqual(builtInExtensionsDirectory);
|
|
done();
|
|
});
|
|
});
|
|
});
|