diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_zip_size_limit.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_zip_size_limit.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_zip_size_limit.py b/packages/meshbay-hub/tests/test_zip_size_limit.py index 26c5552..9243fd1 100644 --- a/packages/meshbay-hub/tests/test_zip_size_limit.py +++ b/packages/meshbay-hub/tests/test_zip_size_limit.py @@ -14,7 +14,7 @@ of allowance and nobody would ever notice. And that the two limits in play do not contradict each other: ZIP_MAX_BYTES (512 MB) bounds the archive, while MEMORY_CEILING (100 MB, test_memory_ceiling.py) bounds what may be built in the page — so a 400 MB zip is allowed when there is somewhere to stream it and -refused when the only route left is memory. The `confirm()` that offers the +refused when the only route left is memory. The `ask()` that offers the build-in-memory path therefore only ever appears below the ceiling. """ @@ -47,6 +47,11 @@ def _run(total_bytes, tmp_path, picker=False): (sandbox / src.name).write_text(src.read_text(encoding="utf-8"), encoding="utf-8") (tmp_path / "package.json").write_text('{"type":"module"}') + # ask.js draws a dialog in the DOM, which Node has none of; the question is + # answered here instead, exactly where `confirm` used to be stubbed. + (sandbox / "ask.js").write_text( + "export const ask = async (q) => globalThis.confirm(q);\n" + "export const tell = async () => {};\n", encoding="utf-8") script = tmp_path / "case.mjs" picker_js = "true" if picker else "false" |