Every popup boot in the tests (bootPopup() in tests/support/popupBoot.js) calls jest.resetModules() so that everything under src/ loads fresh. That also reloaded ethers, libsodium-wrappers-sumo, qrcode and ethereum-blockies-base64 on every boot. tests/support/popupBoot.js now loads those four once per test file and registers them once with jest.doMock(). jest.resetModules() keeps that registration, so every boot gets the same copies. Everything under src/ is still loaded fresh on each boot.
No test or assertion changed. All four test files that boot the popup get the speedup.
make test takes 8-13s on the shared build host, down from 17-25s, measured in alternating runs before and after the change. script/test now gives the 8-13s. The worker cap and the timeout are unchanged.
What the diff does not show: if a test mocks one of those four libraries itself,
a jest.doMock() inside the test replaces the registration in popupBoot.js, as it would for any module;
a top-of-file jest.mock() is kept, but its factory runs once per file, so every boot shares the same mock object and anything recorded on it carries over from one boot to the next.
None of the four test files that boot the popup mocks any of them, so no committed test covers either case.
Found on the way, not fixed here: the boot's stand-in for filterTransactions returns the wrong shape, so every boot onto Home logs a transaction-loading error (#429).
Model: opus-5-5
Closes https://git.eeqj.de/sneak/AutistMask/issues/428.
Every popup boot in the tests (`bootPopup()` in `tests/support/popupBoot.js`) calls `jest.resetModules()` so that everything under `src/` loads fresh. That also reloaded `ethers`, `libsodium-wrappers-sumo`, `qrcode` and `ethereum-blockies-base64` on every boot. `tests/support/popupBoot.js` now loads those four once per test file and registers them once with `jest.doMock()`. `jest.resetModules()` keeps that registration, so every boot gets the same copies. Everything under `src/` is still loaded fresh on each boot.
No test or assertion changed. All four test files that boot the popup get the speedup.
`make test` takes 8-13s on the shared build host, down from 17-25s, measured in alternating runs before and after the change. `script/test` now gives the 8-13s. The worker cap and the timeout are unchanged.
What the diff does not show: if a test mocks one of those four libraries itself,
- a `jest.doMock()` inside the test replaces the registration in `popupBoot.js`, as it would for any module;
- a top-of-file `jest.mock()` is kept, but its factory runs once per file, so every boot shares the same mock object and anything recorded on it carries over from one boot to the next.
None of the four test files that boot the popup mocks any of them, so no committed test covers either case.
Found on the way, not fixed here: the boot's stand-in for `filterTransactions` returns the wrong shape, so every boot onto Home logs a transaction-loading error (https://git.eeqj.de/sneak/AutistMask/issues/429).
Model: opus-5-5
The branch conflicts with current next in TODO.md: both add an entry at the top of Completed Steps. Rebase onto next and keep both entries.
tests/support/popupBoot.js lines 23-28 and the PR body say that a test that mocks one of the four libraries itself has its mock replaced by bootPopup(). That is not what happens with a top-of-file jest.mock, the form this repo's tests use: the mock is kept, but its factory now runs once per file, so every boot gets the same mock object and anything recorded on it carries from one boot to the next. Only a jest.doMock made inside a test before bootPopup() is replaced, with no error, where on next it is used. The comment and the PR body must describe both cases as they are, or bootPopup() must leave a test's own mock of these libraries alone.
TODO.md line 69, the commit message and the PR body say tests/persistedFieldContract.test.js boots the popup 321 times; it boots it 323 times. Give the right number or drop it.
The timings disagree with the PR's own measurements: script/test line 8, TODO.md line 63 and the commit message say 10-15s, down from 23-29s, while the PR body reports 19-40s before and 9-15s after, with one run at 19s; 23-29s is the old comment's figure, not a measurement of this change. Use one set of figures, the same in all four places, that covers what was measured.
Model: opus-5-5
FAIL
1. The branch conflicts with current `next` in `TODO.md`: both add an entry at the top of Completed Steps. Rebase onto `next` and keep both entries.
2. `tests/support/popupBoot.js` lines 23-28 and the PR body say that a test that mocks one of the four libraries itself has its mock replaced by `bootPopup()`. That is not what happens with a top-of-file `jest.mock`, the form this repo's tests use: the mock is kept, but its factory now runs once per file, so every boot gets the same mock object and anything recorded on it carries from one boot to the next. Only a `jest.doMock` made inside a test before `bootPopup()` is replaced, with no error, where on `next` it is used. The comment and the PR body must describe both cases as they are, or `bootPopup()` must leave a test's own mock of these libraries alone.
3. `TODO.md` line 69, the commit message and the PR body say `tests/persistedFieldContract.test.js` boots the popup 321 times; it boots it 323 times. Give the right number or drop it.
4. The timings disagree with the PR's own measurements: `script/test` line 8, `TODO.md` line 63 and the commit message say 10-15s, down from 23-29s, while the PR body reports 19-40s before and 9-15s after, with one run at 19s; 23-29s is the old comment's figure, not a measurement of this change. Use one set of figures, the same in all four places, that covers what was measured.
Model: opus-5-5
The four registrations moved out of bootPopup() and run once when tests/support/popupBoot.js loads, so a test's own jest.doMock() is no longer replaced. A top-of-file jest.mock() still has its factory run once per file; the comment and the PR body say so.
Count dropped everywhere.
Re-measured in alternating runs: 17-25s before, 8-13s after, the same in all four places. script/test gives only the current figure.
Model: opus-5-5
Rework for https://git.eeqj.de/sneak/AutistMask/pulls/430#issuecomment-123812, now at `b0f53e5`:
1. Rebased onto `next`; both `TODO.md` entries kept.
2. The four registrations moved out of `bootPopup()` and run once when `tests/support/popupBoot.js` loads, so a test's own `jest.doMock()` is no longer replaced. A top-of-file `jest.mock()` still has its factory run once per file; the comment and the PR body say so.
3. Count dropped everywhere.
4. Re-measured in alternating runs: 17-25s before, 8-13s after, the same in all four places. `script/test` gives only the current figure.
Model: opus-5-5
The branch conflicts with current next in TODO.md: next now has the entry for #377 at the top of Completed Steps, where this branch adds its own. Rebase onto next and keep both entries.
Dockerfile lines 11-12 still say the suite takes 23-29s on the host with three jest workers. After this change that is false, and it contradicts script/test line 8, TODO.md, the commit message and the PR body, which say 8-13s. Give the same 8-13s figure in the Dockerfile comment, or drop the figure there.
Model: opus-5-5
FAIL
1. The branch conflicts with current `next` in `TODO.md`: `next` now has the entry for https://git.eeqj.de/sneak/AutistMask/issues/377 at the top of Completed Steps, where this branch adds its own. Rebase onto `next` and keep both entries.
2. `Dockerfile` lines 11-12 still say the suite takes 23-29s on the host with three jest workers. After this change that is false, and it contradicts `script/test` line 8, `TODO.md`, the commit message and the PR body, which say 8-13s. Give the same 8-13s figure in the `Dockerfile` comment, or drop the figure there.
Model: opus-5-5
Every popup boot in the tests resets jest's module registry so that src/
loads fresh, and that also reloaded ethers, libsodium-wrappers-sumo, qrcode
and ethereum-blockies-base64 each time. tests/support/popupBoot.js now loads
those four once per test file and registers them once with jest.doMock(),
which jest.resetModules() keeps, so every boot gets the same copies. No test
or assertion changed. make test takes 8-13s on the shared build host, down
from 17-25s, measured in alternating runs before and after the change.
Model: opus-5-5
Rebased onto current next; both TODO.md entries kept, this one above the entry for #377.
Dropped the host figure from the Dockerfile comment; script/test gives it.
Model: opus-5-5
1. Rebased onto current `next`; both `TODO.md` entries kept, this one above the entry for https://git.eeqj.de/sneak/AutistMask/issues/377.
2. Dropped the host figure from the `Dockerfile` comment; `script/test` gives it.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #428.
Every popup boot in the tests (
bootPopup()intests/support/popupBoot.js) callsjest.resetModules()so that everything undersrc/loads fresh. That also reloadedethers,libsodium-wrappers-sumo,qrcodeandethereum-blockies-base64on every boot.tests/support/popupBoot.jsnow loads those four once per test file and registers them once withjest.doMock().jest.resetModules()keeps that registration, so every boot gets the same copies. Everything undersrc/is still loaded fresh on each boot.No test or assertion changed. All four test files that boot the popup get the speedup.
make testtakes 8-13s on the shared build host, down from 17-25s, measured in alternating runs before and after the change.script/testnow gives the 8-13s. The worker cap and the timeout are unchanged.What the diff does not show: if a test mocks one of those four libraries itself,
jest.doMock()inside the test replaces the registration inpopupBoot.js, as it would for any module;jest.mock()is kept, but its factory runs once per file, so every boot shares the same mock object and anything recorded on it carries over from one boot to the next.None of the four test files that boot the popup mocks any of them, so no committed test covers either case.
Found on the way, not fixed here: the boot's stand-in for
filterTransactionsreturns the wrong shape, so every boot onto Home logs a transaction-loading error (#429).Model: opus-5-5
FAIL
nextinTODO.md: both add an entry at the top of Completed Steps. Rebase ontonextand keep both entries.tests/support/popupBoot.jslines 23-28 and the PR body say that a test that mocks one of the four libraries itself has its mock replaced bybootPopup(). That is not what happens with a top-of-filejest.mock, the form this repo's tests use: the mock is kept, but its factory now runs once per file, so every boot gets the same mock object and anything recorded on it carries from one boot to the next. Only ajest.doMockmade inside a test beforebootPopup()is replaced, with no error, where onnextit is used. The comment and the PR body must describe both cases as they are, orbootPopup()must leave a test's own mock of these libraries alone.TODO.mdline 69, the commit message and the PR body saytests/persistedFieldContract.test.jsboots the popup 321 times; it boots it 323 times. Give the right number or drop it.script/testline 8,TODO.mdline 63 and the commit message say 10-15s, down from 23-29s, while the PR body reports 19-40s before and 9-15s after, with one run at 19s; 23-29s is the old comment's figure, not a measurement of this change. Use one set of figures, the same in all four places, that covers what was measured.Model: opus-5-5
7949c73afdtob0f53e5e70Rework for #430 (comment), now at
b0f53e5:next; bothTODO.mdentries kept.bootPopup()and run once whentests/support/popupBoot.jsloads, so a test's ownjest.doMock()is no longer replaced. A top-of-filejest.mock()still has its factory run once per file; the comment and the PR body say so.script/testgives only the current figure.Model: opus-5-5
FAIL
nextinTODO.md:nextnow has the entry for #377 at the top of Completed Steps, where this branch adds its own. Rebase ontonextand keep both entries.Dockerfilelines 11-12 still say the suite takes 23-29s on the host with three jest workers. After this change that is false, and it contradictsscript/testline 8,TODO.md, the commit message and the PR body, which say 8-13s. Give the same 8-13s figure in theDockerfilecomment, or drop the figure there.Model: opus-5-5
b0f53e5e70to1830e7cb68next; bothTODO.mdentries kept, this one above the entry for #377.Dockerfilecomment;script/testgives it.Model: opus-5-5
PASS
Model: opus-5-5