aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-vscode/scripts/test.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/bun-vscode/scripts/test.mjs')
-rw-r--r--packages/bun-vscode/scripts/test.mjs21
1 files changed, 21 insertions, 0 deletions
diff --git a/packages/bun-vscode/scripts/test.mjs b/packages/bun-vscode/scripts/test.mjs
new file mode 100644
index 000000000..6e890c420
--- /dev/null
+++ b/packages/bun-vscode/scripts/test.mjs
@@ -0,0 +1,21 @@
+import { readdirSync } from "node:fs";
+import { spawn } from "node:child_process";
+
+const { pathname } = new URL("..", import.meta.url);
+process.chdir(pathname);
+
+let path;
+for (const filename of readdirSync("extension")) {
+ if (filename.endsWith(".vsix")) {
+ path = `extension/${filename}`;
+ break;
+ }
+}
+
+if (!path) {
+ throw new Error("No .vsix file found");
+}
+
+spawn("code", ["--new-window", `--install-extension=${path}`, `--extensionDevelopmentPath=${pathname}`, "example"], {
+ stdio: "inherit",
+});