qunitx-cli 0.23.0 → 0.23.1

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 +28 -20
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -374,7 +374,7 @@ var init_package = __esm({
374
374
  package_default = {
375
375
  name: "qunitx-cli",
376
376
  type: "module",
377
- version: "0.23.0",
377
+ version: "0.23.1",
378
378
  description: "Browser runner for QUnitx: run your qunitx tests in google-chrome",
379
379
  author: "Izel Nakri",
380
380
  license: "MIT",
@@ -3573,19 +3573,26 @@ function setupFileWatchers(testFileLookupPaths, config, onEventFunc, onFinishFun
3573
3573
  const parentDir = path9.dirname(watchPath);
3574
3574
  const watchedBasename = path9.basename(watchPath);
3575
3575
  let parentUnlinkFired = false;
3576
- const parentWatcher = fs11.watch(parentDir, async (eventType, filename) => {
3577
- if (!ready || filename !== watchedBasename || eventType !== "rename") return;
3578
- if (parentUnlinkFired) return;
3576
+ let rescanTimer = null;
3577
+ const tryFireParentUnlink = async () => {
3578
+ if (parentUnlinkFired) return false;
3579
3579
  parentUnlinkFired = true;
3580
3580
  try {
3581
3581
  await stat(watchPath);
3582
3582
  parentUnlinkFired = false;
3583
+ return false;
3583
3584
  } catch {
3584
3585
  handleWatchEvent(config, extensions, "unlinkDir", watchPath, onEventFunc, onFinishFunc);
3585
3586
  childWatcher.close();
3586
3587
  parentWatcher.close();
3588
+ if (rescanTimer) clearInterval(rescanTimer);
3587
3589
  delete fileWatchers[watchPath];
3590
+ return true;
3588
3591
  }
3592
+ };
3593
+ const parentWatcher = fs11.watch(parentDir, async (eventType, filename) => {
3594
+ if (!ready || filename !== watchedBasename || eventType !== "rename") return;
3595
+ await tryFireParentUnlink();
3589
3596
  });
3590
3597
  parentWatchers.push(parentWatcher);
3591
3598
  fileWatchers[watchPath] = childWatcher;
@@ -3598,22 +3605,23 @@ function setupFileWatchers(testFileLookupPaths, config, onEventFunc, onFinishFun
3598
3605
  )
3599
3606
  );
3600
3607
  if (process.platform === "darwin") {
3601
- rescanTimers.push(
3602
- setInterval(() => {
3603
- if (!ready || rescanInProgress) return;
3604
- rescanInProgress = true;
3605
- rescanDirectoryForDelta(
3606
- watchPath,
3607
- config,
3608
- extensions,
3609
- onEventFunc,
3610
- onFinishFunc,
3611
- trackSymlink
3612
- ).finally(() => {
3613
- rescanInProgress = false;
3614
- });
3615
- }, RESCAN_INTERVAL_MS).unref()
3616
- );
3608
+ rescanTimer = setInterval(async () => {
3609
+ if (!ready || rescanInProgress || parentUnlinkFired) return;
3610
+ if (await tryFireParentUnlink()) return;
3611
+ rescanInProgress = true;
3612
+ rescanDirectoryForDelta(
3613
+ watchPath,
3614
+ config,
3615
+ extensions,
3616
+ onEventFunc,
3617
+ onFinishFunc,
3618
+ trackSymlink
3619
+ ).finally(() => {
3620
+ rescanInProgress = false;
3621
+ });
3622
+ }, RESCAN_INTERVAL_MS);
3623
+ rescanTimer.unref();
3624
+ rescanTimers.push(rescanTimer);
3617
3625
  }
3618
3626
  }
3619
3627
  readyPromises.push(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx-cli",
3
3
  "type": "module",
4
- "version": "0.23.0",
4
+ "version": "0.23.1",
5
5
  "description": "Browser runner for QUnitx: run your qunitx tests in google-chrome",
6
6
  "author": "Izel Nakri",
7
7
  "license": "MIT",