tauri-test-cli 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +14 -25
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -122032,35 +122032,24 @@ async function startServer(options) {
122032
122032
  const { port, appPath, waitTimeout, autoWait } = options;
122033
122033
  process.on("SIGINT", shutdown);
122034
122034
  process.on("SIGTERM", shutdown);
122035
- const getAncestorPids = () => {
122036
- const pids = [];
122037
- let pid = process.pid;
122038
- while (pid > 1) {
122039
- try {
122040
- const stat = readFileSync(`/proc/${pid}/stat`, "utf8");
122041
- const ppid = parseInt(stat.split(") ")[1].split(" ")[1]);
122042
- if (ppid <= 1)
122043
- break;
122044
- pids.push(ppid);
122045
- pid = ppid;
122046
- } catch {
122047
- break;
122048
- }
122035
+ const getDirectParentPid = () => {
122036
+ try {
122037
+ const stat = readFileSync(`/proc/${process.pid}/stat`, "utf8");
122038
+ return parseInt(stat.split(") ")[1].split(" ")[1]);
122039
+ } catch {
122040
+ return process.ppid;
122049
122041
  }
122050
- return pids;
122051
122042
  };
122052
- const ancestorPids = getAncestorPids();
122053
- if (ancestorPids.length > 0) {
122043
+ const parentPid = getDirectParentPid();
122044
+ if (parentPid > 1) {
122054
122045
  setInterval(() => {
122055
- for (const pid of ancestorPids) {
122056
- try {
122057
- process.kill(pid, 0);
122058
- } catch {
122059
- shutdown();
122060
- return;
122061
- }
122046
+ try {
122047
+ process.kill(parentPid, 0);
122048
+ } catch {
122049
+ shutdown();
122050
+ return;
122062
122051
  }
122063
- }, 500);
122052
+ }, 2000);
122064
122053
  }
122065
122054
  console.error(`Launching app and waiting for load (timeout: ${waitTimeout}ms)...`);
122066
122055
  await connect2({ appPath, waitTimeout });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-test-cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "CLI for testing Tauri applications with screenshot capture, DOM inspection, and user interaction simulation",
5
5
  "type": "module",
6
6
  "bin": {