qunitx-cli 0.22.0 → 0.22.2

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 +17 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2647,6 +2647,7 @@ import { readdir, stat, lstat } from "node:fs/promises";
2647
2647
  import path8 from "node:path";
2648
2648
  function setupFileWatchers(testFileLookupPaths, config, onEventFunc, onFinishFunc) {
2649
2649
  const extensions = config.extensions || defaultProjectConfigValues.extensions;
2650
+ config._lastBuildEndMs ??= Date.now();
2650
2651
  const readyPromises = [];
2651
2652
  const parentWatchers = [];
2652
2653
  const rescanTimers = [];
@@ -2841,6 +2842,7 @@ async function rescanDirectoryForDelta(watchPath, config, extensions, onEventFun
2841
2842
  const presentPaths = /* @__PURE__ */ new Set();
2842
2843
  const presentDirs = /* @__PURE__ */ new Set();
2843
2844
  presentDirs.add(watchPath);
2845
+ const trackedToRecheck = [];
2844
2846
  for (const entry of entries) {
2845
2847
  if (entry.isDirectory()) {
2846
2848
  presentDirs.add(path8.join(entry.parentPath, entry.name));
@@ -2854,8 +2856,22 @@ async function rescanDirectoryForDelta(watchPath, config, extensions, onEventFun
2854
2856
  if (!(entryPath in config.fsTree)) {
2855
2857
  if (entry.isSymbolicLink()) trackSymlinkFn?.(entryPath);
2856
2858
  handleWatchEvent(config, extensions, "add", entryPath, onEventFunc, onFinishFunc);
2859
+ } else if (config._lastBuildEndMs) {
2860
+ trackedToRecheck.push(entryPath);
2857
2861
  }
2858
2862
  }
2863
+ const buildEndMs = config._lastBuildEndMs ?? 0;
2864
+ await Promise.all(
2865
+ trackedToRecheck.map(async (filePath) => {
2866
+ try {
2867
+ const { mtimeMs } = await stat(filePath);
2868
+ if (mtimeMs > buildEndMs) {
2869
+ handleWatchEvent(config, extensions, "change", filePath, onEventFunc, onFinishFunc);
2870
+ }
2871
+ } catch {
2872
+ }
2873
+ })
2874
+ );
2859
2875
  const watchPrefix = watchPath + path8.sep;
2860
2876
  const firedDirPrefixes = [];
2861
2877
  for (const trackedPath of Object.keys(config.fsTree)) {
@@ -3442,7 +3458,7 @@ init_color();
3442
3458
  var package_default = {
3443
3459
  name: "qunitx-cli",
3444
3460
  type: "module",
3445
- version: "0.22.0",
3461
+ version: "0.22.2",
3446
3462
  description: "Browser runner for QUnitx: run your qunitx tests in google-chrome",
3447
3463
  author: "Izel Nakri",
3448
3464
  license: "MIT",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qunitx-cli",
3
3
  "type": "module",
4
- "version": "0.22.0",
4
+ "version": "0.22.2",
5
5
  "description": "Browser runner for QUnitx: run your qunitx tests in google-chrome",
6
6
  "author": "Izel Nakri",
7
7
  "license": "MIT",