Skip to content

test: clean web runner warnings - #49

Merged
rafia9005 merged 4 commits into
devfrom
coderabbit/web-unit-test-cleanup-dev
Jul 9, 2026
Merged

test: clean web runner warnings#49
rafia9005 merged 4 commits into
devfrom
coderabbit/web-unit-test-cleanup-dev

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add frontend store unit coverage for auth and data stores
  • keep test console mocks scoped with try/finally cleanup
  • configure Vitest workers to suppress noisy Node runtime warnings
  • route Vite and Vitest npm scripts through a scoped DEP0205 suppression for Node's deprecated module.register() warning

Verification

  • npm run type-check --prefix web
  • npm run build-only --prefix web
  • npm run test:unit --prefix web -- --run
  • bounded npm run dev --prefix web smoke test with grep confirming no DEP0205 or module.register() deprecation output
  • bounded npm run test:unit --prefix web smoke test with grep confirming no localStorage is not available, --localstorage-file was not provided, ExperimentalWarning, or DEPRECATED output

Initiative Context

Final Prompt

okay, that's good, but have warning again
(node:107773) [DEP0205] DeprecationWarning: module.register() is deprecated. Use module.registerHooks() instead.
this one, fix it

Final Plan

  1. Reproduce the DEP0205 warning and determine whether it comes from repo code or upstream Vite/Vitest bootstrap.
  2. Validate the repo's build, dev, type-check, and unit-test paths against the active Node runtime.
  3. Apply the least invasive fix in project scripts so Vite/Vitest run without surfacing the deprecated loader warning.
  4. Re-run the affected commands and grep logs for the reported deprecation.
  5. Push the follow-up commit to the existing PR and refresh the PR description.

Summary by CodeRabbit

  • Bug Fixes
    • Updated app and test commands to run consistently through local binaries, helping avoid runtime warning noise during development and builds.
  • Tests
    • Improved test coverage for error-handling paths, including session cleanup and chart-loading failures.
    • Added checks to confirm warnings and errors are logged as expected, while keeping test output clean.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Review Change Stack

📝 Walkthrough

Walkthrough

The web package updates how Vitest and Vite are launched, adds a Vitest no-warnings setting, and strengthens two store failure tests by asserting their logged console output.

Changes

Test tooling and console assertions

Layer / File(s) Summary
Vitest invocation and config
web/package.json, web/vitest.config.ts
Package scripts now run Vite and Vitest through direct Node entrypoints, and Vitest test execution adds --no-warnings via execArgv.
Store failure log assertions
web/src/stores/__tests__/authStore.test.ts, web/src/stores/__tests__/dataStores.test.ts
Failure-path tests now spy on console.warn and console.error, assert the expected logged messages, and restore the spies after the assertions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: reducing web test runner warnings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@rafia9005
rafia9005 self-requested a review July 9, 2026 03:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
web/src/stores/__tests__/authStore.test.ts (1)

58-74: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Spy restore isn't exception-safe.

warnSpy.mockRestore() at Line 74 only runs if all preceding expect() calls pass. If any assertion between Lines 65-72 throws, the spy leaks into later tests, potentially masking or altering subsequent console-based assertions. Wrapping in try/finally, or restoring in an afterEach, would make cleanup reliable regardless of assertion outcome.

Suggested fix
     const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})

     cookiesMock.get.mockReturnValueOnce('bad-token')
     fetchMock.get.mockRejectedValueOnce(new Error('unauthorized'))

-    await expect(store.verifyToken()).resolves.toBe(false)
-
-    expect(warnSpy).toHaveBeenCalledWith(
-      'Token verification failed on server, clearing session:',
-      expect.any(Error),
-    )
-    expect(cookiesMock.remove).toHaveBeenCalledWith('accessToken')
-    expect(cookiesMock.remove).toHaveBeenCalledWith('refreshToken')
-    expect(store.currentUser).toBeNull()
-    expect(store.isAuthenticated).toBe(false)
-
-    warnSpy.mockRestore()
+    try {
+      await expect(store.verifyToken()).resolves.toBe(false)
+
+      expect(warnSpy).toHaveBeenCalledWith(
+        'Token verification failed on server, clearing session:',
+        expect.any(Error),
+      )
+      expect(cookiesMock.remove).toHaveBeenCalledWith('accessToken')
+      expect(cookiesMock.remove).toHaveBeenCalledWith('refreshToken')
+      expect(store.currentUser).toBeNull()
+      expect(store.isAuthenticated).toBe(false)
+    } finally {
+      warnSpy.mockRestore()
+    }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/stores/__tests__/authStore.test.ts` around lines 58 - 74, The
console.warn spy cleanup in the authStore verifyToken test is not
exception-safe, so it may leak into later tests if an assertion fails. Move the
warnSpy.mockRestore() cleanup in this test to a try/finally block, or restore
the spy in an afterEach hook, so the spy is always reset regardless of failures.
Keep the fix localized around the verifyToken test and the warnSpy setup.
web/package.json (1)

10-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

mkdir -p may not be portable on native Windows shells.

If any contributor or CI runner executes npm run test:unit under a plain cmd.exe (no bash/WSL), mkdir -p isn't guaranteed to behave the same, and the whole compound && command could break. Consider using mkdirp/shx mkdir -p (or a Node one-liner) for cross-platform safety, or confirm all execution environments provide a POSIX-compatible shell.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/package.json` at line 10, The test:unit script uses a shell-specific
mkdir -p command that may fail on native Windows cmd.exe. Update the script in
package.json to use a cross-platform directory creation approach, such as shx
mkdir -p, mkdirp, or a small Node-based command, while keeping the rest of the
vitest invocation unchanged. Use the test:unit script entry as the place to fix
it so the command works reliably across all supported environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/package.json`:
- Line 10: The test:unit script in package.json uses --localstorage-file, which
is not supported by the currently declared Node engine range. Update the engines
field to require a Node version that supports this flag (for example, >=22.4.0),
or change the test:unit command to conditionally use the flag based on the Node
version; keep the fix localized to package.json and the test:unit entry.

---

Nitpick comments:
In `@web/package.json`:
- Line 10: The test:unit script uses a shell-specific mkdir -p command that may
fail on native Windows cmd.exe. Update the script in package.json to use a
cross-platform directory creation approach, such as shx mkdir -p, mkdirp, or a
small Node-based command, while keeping the rest of the vitest invocation
unchanged. Use the test:unit script entry as the place to fix it so the command
works reliably across all supported environments.

In `@web/src/stores/__tests__/authStore.test.ts`:
- Around line 58-74: The console.warn spy cleanup in the authStore verifyToken
test is not exception-safe, so it may leak into later tests if an assertion
fails. Move the warnSpy.mockRestore() cleanup in this test to a try/finally
block, or restore the spy in an afterEach hook, so the spy is always reset
regardless of failures. Keep the fix localized around the verifyToken test and
the warnSpy setup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce32812e-72b9-4cfd-ab35-3f5bdfd3e0c3

📥 Commits

Reviewing files that changed from the base of the PR and between d2f80bb and 0879e5e.

📒 Files selected for processing (3)
  • web/package.json
  • web/src/stores/__tests__/authStore.test.ts
  • web/src/stores/__tests__/dataStores.test.ts

Comment thread web/package.json Outdated
@rafia9005

Copy link
Copy Markdown
Member

@coderabbitai that's save? use mkdir on package json? why not vitest? give me the reason.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cat -n web/package.json | sed -n '1,40p'

Length of output: 1669


🏁 Script executed:

# Check whether `cross-env` is already a devDependency, and whether a vitest setup file / vitest.config already exists
rg -n '"cross-env"' web/package.json
fd -HI 'vitest.setup|vitest.config' web

Length of output: 355


🏁 Script executed:

#!/bin/bash
cat -n web/vitest.config.ts
echo "---"
fd -HI 'setup' web/src -e ts

Length of output: 702


@rafia9005 Follow-up confirmation from digging further:

  • web/vitest.config.ts sets environment: 'jsdom', so localStorage inside your tests comes from jsdom's own implementation — not Node's experimental global. That means the experimental warning likely isn't coming from your actual test assertions, but from Vitest's own process bootstrap touching the global localStorage in the Node context before the jsdom environment takes over.
  • There's no existing Vitest setup file (fd found none under web/src), and cross-env isn't currently a devDependency.

This reinforces the earlier point: the warning is a side effect of Node's process-level global, not something your test code controls — so suppressing it via NODE_OPTIONS=--no-warnings (optionally wrapped in cross-env for Windows portability) is a more targeted fix than routing through --localstorage-file and hardcoding ./node_modules/vitest/vitest.mjs.

Let me know if you'd like me to go ahead with that plan (swap the script for cross-env NODE_OPTIONS=--no-warnings vitest or similar), or if you'd rather keep the current approach as-is.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review in the latest commit.

Reasoning: direct vitest is fine when no Node runtime flags are needed, but --localstorage-file is a Node flag, not a Vitest flag. Running Vitest through a small Node wrapper lets the test command pass that flag on Node versions that support it, while keeping Node 20-compatible fallback behavior. I also replaced the mkdir -p shell command with fs.mkdirSync(..., { recursive: true }) inside the wrapper so the script is portable across shells, and made the console spies restore with try/finally.

@rafia9005

Copy link
Copy Markdown
Member

@coderabbitai

 DEV  v4.1.8 /home/rafii/Documents/ping-uptime/web

(node:95580) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:95584) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/composables/__tests__/useAppTitle.test.ts (3 tests) 101ms
 ✓ src/composables/__tests__/useUpdateChecker.test.ts (2 tests) 120ms
 ✓ src/stores/__tests__/dataStores.test.ts (15 tests) 65ms
 ✓ src/composables/__tests__/storeBindings.test.ts (18 tests) 44ms
(node:95611) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/stores/__tests__/realtimeStores.test.ts (4 tests) 25ms
(node:95617) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/stores/__tests__/authStore.test.ts (4 tests) 27ms
 ✓ src/validations/__tests__/schemas.test.ts (7 tests) 26ms
(node:95635) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/stores/__tests__/backupStore.test.ts (3 tests) 41ms
(node:95656) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:95650) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/composables/__tests__/useNotificationLogs.test.ts (3 tests) 15ms
(node:95665) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/composables/__tests__/useIncidents.test.ts (3 tests) 24ms
 ✓ src/composables/__tests__/useSslMonitors.test.ts (3 tests) 16ms
 ✓ src/lib/__tests__/utils.test.ts (2 tests) 17ms
(node:95689) ExperimentalWarning: localStorage is not available because --localstorage-file was not provided.
(Use `node --trace-warnings ...` to show where the warning was created)
 ✓ src/composables/__tests__/useApiTokens.test.ts (1 test) 9ms

 Test Files  13 passed (13)
      Tests  68 passed (68)
   Start at  10:37:36
   Duration  7.14s (transform 1.24s, setup 0ms, import 3.48s, tests 531ms, environment 17.40s)

after try checkout coderabbit/web-unit-test-cleanup-dev and see the log, the result/return is like this, show error node warning localstorage-file

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cat -n web/vitest.config.ts

Length of output: 658


@rafia9005 Good catch — that confirms my earlier hypothesis. Here's the actual reason it's still happening on the branch:

Root cause: web/vitest.config.ts has no pool/poolOptions set, so Vitest uses its default worker pool (forks), which spawns a separate Node process for each test file/worker. That's exactly why your log shows distinct PIDs (95580, 95584, 95611, 95617, 95635, 95650, 95656, 95665, 95689) — one per worker.

The current script:

"test:unit": "mkdir -p node_modules/.tmp && node --localstorage-file=node_modules/.tmp/vitest-localstorage ./node_modules/vitest/vitest.mjs"

only passes --localstorage-file to the top-level node process that boots Vitest. Vitest's internal worker pool spawns its own independent Node processes to actually run the test files, and those workers do not inherit CLI flags given to the parent invocation — only environment variables are inherited by child processes. So each worker re-triggers the experimental warning on its own, regardless of what you passed to the outer node call. That's also part of why hardcoding ./node_modules/vitest/vitest.mjs and doing mkdir -p in the script isn't a great pattern — it's brittle (breaks if the vitest binary path changes) and doesn't actually reach the workers.

Two proper fixes, either works:

  1. Env var approach (simplest, inherited by all spawned processes):
"test:unit": "cross-env NODE_OPTIONS=--no-warnings vitest"

or if you specifically want the localStorage file behavior everywhere:

"test:unit": "cross-env NODE_OPTIONS=--localstorage-file=node_modules/.tmp/vitest-localstorage vitest"

(needs cross-env as a devDependency for Windows portability, and the .tmp dir can be created once via a pretest:unit script or just committed as ensured by mkdir -p in a separate lifecycle script, not the main test command.)

  1. Vitest-native approach (recommended, no extra dependency, explicit and documented):
// vitest.config.ts
test: {
  environment: 'jsdom',
  exclude: [...configDefaults.exclude, 'e2e/**'],
  root: fileURLToPath(new URL('./', import.meta.url)),
  poolOptions: {
    forks: {
      execArgv: ['--no-warnings'], // or ['--localstorage-file=node_modules/.tmp/vitest-localstorage']
    },
  },
},

This explicitly forwards the flag to every forked worker process, which is the officially supported way to pass Node args through Vitest's pool, and keeps package.json's test:unit script back to plain vitest.

I'd lean towards option 2 since it keeps the fix scoped to test configuration rather than the npm script, and doesn't require a new dependency. Want me to draft this change?

  • Update web/vitest.config.ts to add poolOptions.forks.execArgv: ['--no-warnings'] (or the --localstorage-file variant) so the flag reaches every Vitest worker process.
  • Revert web/package.json's test:unit script back to plain vitest (dropping the mkdir -p + hardcoded vitest.mjs path).

✏️ Learnings added
Learnt from: rafia9005
URL: https://github.com/terarush/ping-uptime/pull/49

Timestamp: 2026-07-09T03:41:00.052Z
Learning: In `web/vitest.config.ts` (Vitest project under `web/`), CLI flags passed to the top-level `node` invocation in a `test:unit` npm script (e.g., `node --localstorage-file=... ./node_modules/vitest/vitest.mjs`) do NOT propagate to Vitest's worker pool processes, since Vitest's default pool (`forks`) spawns separate Node child processes per test file/worker that don't inherit CLI args from the parent invocation. To pass Node flags (like `--localstorage-file` or `--no-warnings`) to every worker, configure `test.poolOptions.forks.execArgv` (or `threads.execArgv`) in `vitest.config.ts`, or use the `NODE_OPTIONS` environment variable (which is inherited by child processes) instead of a CLI flag.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


The requested changes have been implemented and a pull request has been created: View PR

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up pushed in 228c06f.

Root cause: the previous wrapper passed Node flags only to the parent Vitest process, while Vitest 4 runs tests in forked workers. The warning came from those worker processes, not from missing app auth tokens. The tests use jsdom, so browser localStorage is already available in the test environment.

Changed the PR to use Vitest 4's top-level test.execArgv for workers, restored npm run test:unit to vitest, and removed the wrapper script.

Verified locally:

  • npm run type-check --prefix web
  • npm run test:unit --prefix web -- --run
  • bounded npm run test:unit --prefix web smoke test with grep confirming no localStorage is not available, --localstorage-file was not provided, ExperimentalWarning, or DEPRECATED output

@coderabbitai coderabbitai Bot changed the title test: clean web unit runner output test: clean web runner warnings Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Follow-up pushed in e93a1e6.

This warning is upstream runtime noise from the Node/Vite/Vitest bootstrap path, not from the app code. I couldn't reproduce a concrete in-repo module.register() call to replace, so I fixed it at the script entrypoints instead of muting all warnings globally.

What changed:

  • dev, build-only, and preview now run Vite through node --disable-warning=DEP0205
  • test:unit now runs Vitest through node --disable-warning=DEP0205
  • the existing Vitest worker execArgv handling stays in place for the earlier worker-side warning cleanup

Verified locally:

  • npm run type-check --prefix web
  • npm run build-only --prefix web
  • npm run test:unit --prefix web -- --run
  • bounded npm run dev --prefix web smoke test with no DEP0205 output

@rafia9005

Copy link
Copy Markdown
Member

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/package.json (1)

7-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Hardcoding internal node_modules entrypoints instead of the vite/vitest binaries.

Directly invoking ./node_modules/vite/bin/vite.js and ./node_modules/vitest/vitest.mjs bypasses npm's bin resolution, is fragile if these packages change their entrypoint paths in a future release, and is not portable across package managers (e.g. pnpm's nested/symlinked node_modules layout) or Windows path handling.

♻️ Prefer the standard binaries with NODE_OPTIONS
-    "dev": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js",
+    "dev": "cross-env NODE_OPTIONS=--disable-warning=DEP0205 vite",
     "build": "run-p type-check \"build-only {@}\" --",
-    "preview": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js preview",
-    "test:unit": "node --disable-warning=DEP0205 ./node_modules/vitest/vitest.mjs",
-    "build-only": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js build",
+    "preview": "cross-env NODE_OPTIONS=--disable-warning=DEP0205 vite preview",
+    "test:unit": "vitest",
+    "build-only": "cross-env NODE_OPTIONS=--disable-warning=DEP0205 vite build",

Per the PR comments summary, the recommended direction for test:unit was to move the suppression into vitest.config.ts's test.poolOptions.forks.execArgv (so it reaches forked workers) and simplify this script back to plain vitest. As written, test:unit still hardcodes the vitest entrypoint rather than adopting that simplification.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/package.json` around lines 7 - 11, The test:unit script still hardcodes
the vitest internal entrypoint, which should be simplified to use the standard
binary. Update the package.json scripts so test:unit invokes plain vitest, and
move the DEP0205 suppression into vitest.config.ts under
test.poolOptions.forks.execArgv so it applies to forked workers. Keep the same
approach for the Vite-related scripts by relying on package manager bin
resolution instead of direct node_modules paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/package.json`:
- Around line 7-11: The npm scripts in web/package.json are using the
`--disable-warning` flag unconditionally even though the declared Node range
includes versions that do not support it. Update the `dev`, `preview`,
`test:unit`, and `build-only` script entries to avoid passing that flag on
unsupported Node versions, either by wrapping the Vite invocation in a small
Node version/feature check or by removing the flag from these scripts and
applying it only when the runtime supports it.

---

Nitpick comments:
In `@web/package.json`:
- Around line 7-11: The test:unit script still hardcodes the vitest internal
entrypoint, which should be simplified to use the standard binary. Update the
package.json scripts so test:unit invokes plain vitest, and move the DEP0205
suppression into vitest.config.ts under test.poolOptions.forks.execArgv so it
applies to forked workers. Keep the same approach for the Vite-related scripts
by relying on package manager bin resolution instead of direct node_modules
paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c9933267-23fb-44f6-af82-7a7e8f093494

📥 Commits

Reviewing files that changed from the base of the PR and between 0879e5e and 230ba65.

📒 Files selected for processing (4)
  • web/package.json
  • web/src/stores/__tests__/authStore.test.ts
  • web/src/stores/__tests__/dataStores.test.ts
  • web/vitest.config.ts
✅ Files skipped from review due to trivial changes (1)
  • web/vitest.config.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • web/src/stores/tests/authStore.test.ts
  • web/src/stores/tests/dataStores.test.ts

Comment thread web/package.json
Comment on lines +7 to +11
"dev": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"test:unit": "vitest",
"build-only": "vite build",
"preview": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js preview",
"test:unit": "node --disable-warning=DEP0205 ./node_modules/vitest/vitest.mjs",
"build-only": "node --disable-warning=DEP0205 ./node_modules/vite/bin/vite.js build",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the declared engines range and confirm no other guard exists
cat web/package.json | jq '.engines'
fd -HI '.nvmrc|.tool-versions' web

Repository: terarush/ping-uptime

Length of output: 196


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== web/package.json =="
cat -n web/package.json | sed -n '1,80p'

echo
echo "== vitest config candidates =="
fd -HI 'vitest.config.*' web

Repository: terarush/ping-uptime

Length of output: 2572


Guard --disable-warning behind the supported Node range web/package.json:7-11 still declares node: "^20.19.0 || >=22.12.0", but --disable-warning only exists in Node 21.3+. These scripts will fail on 20.19.0 with an unknown option error. Use a version check/feature-detect wrapper, or drop the flag from the script and apply it only where supported.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/package.json` around lines 7 - 11, The npm scripts in web/package.json
are using the `--disable-warning` flag unconditionally even though the declared
Node range includes versions that do not support it. Update the `dev`,
`preview`, `test:unit`, and `build-only` script entries to avoid passing that
flag on unsupported Node versions, either by wrapping the Vite invocation in a
small Node version/feature check or by removing the flag from these scripts and
applying it only when the runtime supports it.

@rafia9005
rafia9005 merged commit 71555f7 into dev Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant