WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 57cc0c6

Browse files
authored
fix: process.kill no longer logs warnings (#11)
1 parent 23fc47e commit 57cc0c6

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"typecheck": "tsc --noEmit"
4646
},
4747
"dependencies": {
48-
"@webcontainer/api": "^1.5.3"
48+
"@webcontainer/api": "^1.6.1"
4949
},
5050
"peerDependencies": {
5151
"@vitest/browser": "^3.1",

pnpm-lock.yaml

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fixtures/process.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,7 @@ export class ProcessWrap {
115115
exit = async () => {
116116
await this._isReady;
117117

118-
// @ts-ignore -- internal check
119-
if (this._webcontainerProcess._process != null) {
120-
this._webcontainerProcess.kill();
121-
}
122-
118+
this._webcontainerProcess.kill();
123119
this._listeners.splice(0);
124120

125121
return this.isDone;

test/run-command.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { test } from "../src";
55
test("user can run commands inside webcontainer", async ({ webcontainer }) => {
66
const output = await webcontainer.runCommand("node", ["--version"]);
77

8-
expect(output).toMatchInlineSnapshot(`"v20.19.0"`);
8+
expect(output).toContain("v20");
99
});
1010

1111
test("user can run interactive commands inside webcontainer", async ({
1212
webcontainer,
1313
}) => {
1414
const { exit, waitForText, write } = webcontainer.runCommand("node");
15-
await waitForText("Welcome to Node.js v20.19.0");
15+
await waitForText("Welcome to Node.js v20");
1616

1717
await write("console.log(20 + 19)\n");
1818
await waitForText("39");

0 commit comments

Comments
 (0)