Skip to content

Commit

Permalink
test: ut
Browse files Browse the repository at this point in the history
  • Loading branch information
jayzhang committed Nov 8, 2024
1 parent 8e46c1f commit b8c6709
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
1 change: 0 additions & 1 deletion packages/vscode-extension/src/utils/processUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ class ProcessUtil {
});
}
}

export const processUtil = new ProcessUtil();
10 changes: 0 additions & 10 deletions packages/vscode-extension/test/utils/processUtil.test.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,18 @@
import { expect } from "chai";
// import child_process from "child_process";
import sinon from "sinon";
import { processUtil } from "../../src/utils/processUtil";

describe("ProcessUtil", () => {
const child_process = require("child_process");
let execStub: any;
const sandbox = sinon.createSandbox();
beforeEach(() => {
execStub = sandbox.stub(child_process, "exec");
});

afterEach(() => {
sandbox.restore();
});

describe("killProcess", () => {
// it("happy", async () => {
// sandbox.stub(process, "platform").value("win32");
// execStub.yields(null);
// await processUtil.killProcess(1234);
// expect(execStub.calledWith(`taskkill /PID 1234 /T /F`)).to.be.true;
// });

it("error", async () => {
sandbox.stub(process, "platform").value("win32");
const error = new Error("exec error");
Expand Down

0 comments on commit b8c6709

Please sign in to comment.