Summary
Togoder Security scanned the npm package @testing-library/jest-dom@7.0.1 on Oct 6, 2026. An AI review of 13 source files produced 1 low severity finding. The overall verdict is medium: the findings flag risky but common patterns (dynamic code, unsafe defaults, broad file or network access) rather than confirmed malware.
Findings 1
Top-level code execution on import
NPS-DC31C93CD3F0
The module calls expect.extend(extensions) at the top level. This executes immediately when the file is imported, mutating the global expect object. While this is typical behavior for a Jest matcher package, it is still top-level side-effect code that runs on import and could be abused in a malicious package. No data exfiltration, credential harvesting, obfuscation, network requests, process spawning, or dynamic code execution is present.
Files reviewed
| File | Verdict | What the reviewer saw |
|---|---|---|
| dist/index.mjs | medium | The file is a standard Jest matcher entry point with a top-level expect.extend call and no malicious patterns observed. |
| dist/index.js | safe | No malicious patterns detected; the file is a simple entry point that imports matchers and testing-library dependencies and registers custom matchers. |
| dist/jest-globals.js | safe | No malicious patterns detected; the file only imports dependencies and extends Jest matchers. |
| dist/jest-globals.mjs | safe | No malicious patterns detected; the file only imports Jest globals and extends matchers at import time. |
| dist/matchers-3ed9c960.js | safe | No malicious patterns detected; the code is a legitimate testing-library matcher bundle with standard DOM utility imports and no suspicious network, filesystem, or process activity. |
| dist/matchers-b01dabb1.mjs | safe | This is a standard build artifact of jest-dom matchers, containing only legitimate DOM testing utilities with no network, filesystem, process, or obfuscated code. |
| dist/matchers.js | safe | No malicious patterns detected; the file is a standard re-export module for @testing-library/jest-dom matchers with no suspicious code execution, network, or filesystem activity. |
| dist/matchers.mjs | safe | This file only re-exports matchers from an internal module and imports dependencies; no malicious patterns detected. |
| dist/vitest.js | safe | No malicious patterns detected |
| dist/vitest.mjs | safe | No malicious patterns detected |
| jest-globals.js | safe | No malicious patterns detected; the file simply imports Jest globals and a local matchers module, then extends expect with the matchers. |
| matchers.js | safe | Cleared by Jev triage; no further analysis needed |
| vitest.js | safe | No malicious patterns detected; the file only imports Vitest and registers custom matchers from a local module. |
Scanned versions of @testing-library/jest-dom
| Version | Verdict | Files | Scanned |
|---|---|---|---|
| 7.0.1 | Needs review | 13 | Oct 6, 2026 |
Frequently asked questions
Is @testing-library/jest-dom safe to use?
No confirmed malware was found in @testing-library/jest-dom@7.0.1, but the review flagged 1 low severity finding for risky patterns worth checking before you rely on it.
Does @testing-library/jest-dom contain malware?
No malware was identified in @testing-library/jest-dom@7.0.1 when Togoder Security scanned it on Oct 6, 2026. A new version can still introduce malicious code, so scan the exact versions in your lockfile.
How was @testing-library/jest-dom checked?
Togoder Security downloaded the published npm package and had an AI model read its 13 source files, looking for install scripts, credential access, network exfiltration, obfuscation, backdoors and crypto-wallet theft. The results are cached by file hash and shown here.
How do I scan @testing-library/jest-dom together with the rest of my dependencies?
Upload your lockfile at https://security.togoder.click/scan or call the API documented at https://security.togoder.click/api-docs. Files that have already been scanned, like the ones in @testing-library/jest-dom@7.0.1, cost nothing.