Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ updates:
# one package that its peers reject. Dependabot puts a dependency in the
# first group it matches, so these sit above `routine`.
react:
# framer-motion 7 accepts only React 18, and @testing-library/react
# 13 only react-dom 18: neither can stay behind on React 19.
patterns: ["react", "react-dom", "@testing-library/react", "framer-motion"]
# @testing-library/react 13 accepts only react-dom 18, so it cannot
# stay behind on React 19.
patterns: ["react", "react-dom", "@testing-library/react"]
fontawesome:
# react-fontawesome 0.2 accepts fontawesome-svg-core up to 6, and the
# icon packages track svg-core's major.
Expand Down
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ point of this family — it rules out ES module `import` between files, `fetch()
JSON, and anything else that needs an origin. Scripts communicate through globals on
`window`, which is a deliberate trade, not an oversight.

`bmi/` has a `package.json`, but only for Jest. The page itself still runs unbuilt.
`bmi/` has a `package.json`, but only for its Vitest tests. Vite runs the tests; the page
itself still runs unbuilt.

### 2. Bundled apps (Vite)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Minor JavaScript and React applications

## Content
* [BMI](/bmi/README.md) - Body mass index calculator webpage + jest
* [BMI](/bmi/README.md) - Body mass index calculator webpage + vitest
* [lemon](/lemon/README.md) - project for <b>Meta-Front End Developer Professional Certificate</b>
* [mathparser](/mathparser/README.md) - a simple math calculator for complex expressions
* [portfolio](/portfolio/README.md) - a React application
Expand Down
31 changes: 12 additions & 19 deletions bmi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,20 @@ The "?" button, next to the theme toggle, explains the units for each mode and h

To run tests -> execute next command line: <b>npm run test</b>

The tests run on [Vitest](https://vitest.dev/). `--globals` in the `test` script provides
`test` and `expect` without an import, as Jest did, so `bmi.test.js` reads the same under
either. Vite is used only to run the tests; the page itself is never built.

bmi tested with Jest until
[GHSA-gcqx-w48m-w2h4](https://github.com/advisories/GHSA-gcqx-w48m-w2h4) was published against
deepmerge, which every Jest release since 25.2 depends on and no deepmerge release fixes.
Vitest does not use deepmerge, and it is what `lemon/react-js`, `portfolio` and `weather`
already test with.

## Notes
<sub>[Back to top](#bmi)</sub>

* bmi.js is a js file with simple js functions, used both by the Jest tests and directly by index.html as a plain `<script>`.
* bmi.test.js is a test file which contains Jest tests.
* bmi.js is a js file with simple js functions, used both by the Vitest tests and directly by index.html as a plain `<script>`.
* bmi.test.js is a test file which contains Vitest tests.
* index.html / css/style.css / js/app.js are the webpage that wraps bmi.js.
* js/theme-init.js applies a saved theme choice before first paint, avoiding a flash of the wrong theme.

## Dependencies
<sub>[Back to top](#bmi)</sub>

`package.json` sets `overrides` for `glob` (^14.0.3) and `minimatch` (^11.0.4). jest 30, the
newest release, still pulls glob 10 and 13 and minimatch 9, which carry two advisories:
[GHSA-3g3m-2fjr-6pw4](https://github.com/advisories/GHSA-3g3m-2fjr-6pw4) (glob before 14.0.2) and
[GHSA-g3hv-75wg-m249](https://github.com/advisories/GHSA-g3hv-75wg-m249) (minimatch before 11.0.1).
glob 14 and minimatch 11 keep the API jest calls, and `jest --coverage` reports the same table
with the override as without it. Remove the `overrides` block once jest depends on those
versions or later.

One advisory stays: deepmerge
([GHSA-gcqx-w48m-w2h4](https://github.com/advisories/GHSA-gcqx-w48m-w2h4), low), which jest
uses to merge its own configuration. No release of deepmerge fixes it.


2 changes: 1 addition & 1 deletion bmi/js/bmi.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function nonWhiteStatusByBmi(bmi) {
}
}

// Guarded so this same file works both under Jest/Node (require, as the
// Guarded so this same file works both under Vitest/Node (require, as the
// tests do) and as a plain <script src="bmi.js"> on the webpage, where
// `module` does not exist and would otherwise throw a ReferenceError.
if (typeof module !== "undefined") {
Expand Down
Loading
Loading