diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5a96047..741efaf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -107,10 +107,17 @@ updates: # ─── Node >= 22 majors: holds lifted 2026-11-04 ────────────────────── # better-sqlite3, @testing-library/jest-dom and cssnano majors were held - # while the host toolchain was Node 20.19 (jest-dom 7 broke 43 suites; - # cssnano 8 calls Set.prototype.difference). The toolchain is Node 24 - # now, so their majors arrive as ordinary Dependabot PRs again; each - # still has to pass `npm run ci` on its own. + # while the host toolchain was Node 20.19 (cssnano 8 calls + # Set.prototype.difference). The toolchain is Node 24 now, so their + # majors arrive as ordinary Dependabot PRs again; each still has to + # pass `npm run ci` on its own. + # + # jest-dom 7's suite breakage was NOT the Node version: it still broke + # 54 suites on Node 24 (#86). jest-dom 7 eagerly requires + # @testing-library/dom, which requires 'fs' at load, so loading it from + # test/test-setup.js cached the memfs `fs` mock and silently overrode + # every test file's own jest.mock('fs', factory). test-setup.js now + # loads jest-dom inside jest.isolateModules; keep it there. # # better-sqlite3 needs more than `npm run ci`: Jest never loads the # native module (shouldUseSqliteBackend defaults to false under Jest, diff --git a/docs/commercial-use-inventory.json b/docs/commercial-use-inventory.json index c4e0f09..91b2952 100644 --- a/docs/commercial-use-inventory.json +++ b/docs/commercial-use-inventory.json @@ -1,5 +1,5 @@ { - "generatedAt": "2026-11-06T20:44:48.205Z", + "generatedAt": "2026-11-07T00:28:55.915Z", "projectLicense": { "riskLevel": "allowed", "reason": "Project license is PolyForm Noncommercial 1.0.0 for personal/noncommercial use. Commercial rights are sold separately; third-party dependency obligations remain governed by their own licenses.", @@ -9842,7 +9842,7 @@ }, { "packageName": "@testing-library/jest-dom", - "version": "6.9.1", + "version": "7.0.1", "license": "MIT", "riskLevel": "allowed", "directRuntime": false, diff --git a/package-lock.json b/package-lock.json index b2fa31c..6e527c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,7 +67,7 @@ "@svgr/webpack": "^8.1.0", "@tailwindcss/postcss": "^4.3.4", "@testing-library/dom": "^10.4.2", - "@testing-library/jest-dom": "^6.9.1", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.3", "@types/debug": "^4.1.13", "@types/graceful-fs": "^4.1.9", @@ -14934,9 +14934,9 @@ } }, "node_modules/@testing-library/jest-dom": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", - "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-7.0.1.tgz", + "integrity": "sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==", "dev": true, "license": "MIT", "dependencies": { @@ -14948,9 +14948,18 @@ "redent": "^3.0.0" }, "engines": { - "node": ">=14", + "node": ">=22", "npm": ">=6", "yarn": ">=1" + }, + "peerDependencies": { + "@testing-library/dom": ">=10 <11", + "vitest": ">= 0.32" + }, + "peerDependenciesMeta": { + "vitest": { + "optional": true + } } }, "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { diff --git a/package.json b/package.json index c96be36..a87acde 100644 --- a/package.json +++ b/package.json @@ -259,7 +259,7 @@ "@svgr/webpack": "^8.1.0", "@tailwindcss/postcss": "^4.3.4", "@testing-library/dom": "^10.4.2", - "@testing-library/jest-dom": "^6.9.1", + "@testing-library/jest-dom": "^7.0.1", "@testing-library/react": "^16.3.3", "@types/debug": "^4.1.13", "@types/graceful-fs": "^4.1.9", diff --git a/test/test-setup.js b/test/test-setup.js index 719bc50..fec71a9 100644 --- a/test/test-setup.js +++ b/test/test-setup.js @@ -4,7 +4,15 @@ */ // Import jest-dom for React Testing Library matchers (toBeInTheDocument, etc.) -require('@testing-library/jest-dom'); +// Loaded in an isolated registry: jest-dom 7 eagerly requires +// @testing-library/dom, which requires 'fs' at load time. Outside isolation +// that instantiates the memfs mock below into the shared mock registry, and a +// test file's own jest.mock('fs', factory) is then ignored (the cached memfs +// wins), so fs.x.mockResolvedValue is undefined. expect.extend() is global, +// so the matchers survive the isolated registry being discarded. +jest.isolateModules(() => { + require('@testing-library/jest-dom'); +}); const { vol, fs: memfs } = require('memfs'); const path = require('path');