mirror of
https://github.com/coder/code-server.git
synced 2024-12-05 07:13:06 +08:00
27 lines
623 B
TypeScript
27 lines
623 B
TypeScript
|
import * as fs from "fs";
|
||
|
import * as util from "util";
|
||
|
import { Module } from "../src/common/proxy";
|
||
|
import { createClient, Helper } from "./helpers";
|
||
|
|
||
|
describe("trash", () => {
|
||
|
const client = createClient();
|
||
|
const trash = client.modules[Module.Trash];
|
||
|
const helper = new Helper("trash");
|
||
|
|
||
|
beforeAll(async () => {
|
||
|
await helper.prepare();
|
||
|
});
|
||
|
|
||
|
it("should trash a file", async () => {
|
||
|
const file = await helper.createTmpFile();
|
||
|
await trash.trash(file);
|
||
|
expect(await util.promisify(fs.exists)(file)).toBeFalsy();
|
||
|
});
|
||
|
|
||
|
it("should dispose", () => {
|
||
|
setTimeout(() => {
|
||
|
client.dispose();
|
||
|
}, 100);
|
||
|
});
|
||
|
});
|