npm / @vitest/mocker / 5.1.0-beta.1
@vitest/mocker 5.1.0-beta.1
- Source
- https://github.com/vitest-dev/vitest
- Tag scanned
v5.1.0-beta.1- Directory
packages/mocker- Compared with
v5.0.5(0 signals introduced since)- Files
- 32 scanned, 1 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 3 info
- Scan time
- 3.6 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 3 of 3 warn and critical signals; 3 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-20 01:11
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
}$` return this.wrapDynamicImport(() => import(/* @vite-ignore */ actualUrl)).then((mod) => { if (!resolved.optimized || typeof mod.default === 'undefined') { return modlikely benign Runtime dynamic import of a resolved module URL inside a browser test mocker.Reasoning
This is a Vite-style module mocker in a test framework. The dynamic import uses a computed URL derived from the module resolution path and is wrapped in a helper, with the @vite-ignore annotation signaling intentional bundler-opt-out. This is standard for runtime module loading in browser test tooling, not obfuscation or malicious execution.
-
const query = url. ? `&t=` : `?t=` const moduleObject = awaitlikely benign Dynamic import of a cache-busted, mock-tagged module path in a browser mocker.Reasoning
The specifier is built from the module pathname, a timestamp query for cache busting, and the mock type. This is a plain template literal for loading mocked modules in a test harness, with the @vite-ignore annotation. No encoding or obfuscation is present, and the input is local module paths.
-
return }likely benign Dynamic import of a configured mock redirect module path.Reasoning
This imports mock.redirect, a configured redirect target for mocking a module. It is a plain dynamic import of a developer-configured path in test tooling. The only risk is that the redirect value is not validated, but it originates from the mocker's own configuration, not untrusted input.
Reproduce This Scan
Run disclude locally to verify. Add --format sarif for SARIF output. Add --llm (with an API key in the environment) to include the LLM review.
&&