When running this test in puppeteer or playwright, the test never finshes. When inspecting the test-browsers devtools, you can see the following error message:
The error seems to originate in a websocket handler, that tries to stringify the error message while skipping circular structures. The stringified object is then send to the wtr-cli for printing. But the decircularization and stringification failes in this case, because the target error message is not mutable.
When asserting frozen objects in WTR, the test-file never finishes according to the cli. Here is a test-case:
When running this test in puppeteer or playwright, the test never finshes. When inspecting the test-browsers devtools, you can see the following error message:
The error seems to originate in a websocket handler, that tries to stringify the error message while skipping circular structures. The stringified object is then send to the wtr-cli for printing. But the decircularization and stringification failes in this case, because the target error message is not mutable.
I've uploaded a working repro of this bug in this repo: https://github.com/lucaelin/wtr-readonly-error-bug
A possible solution is also included in the repository, by first running structuredClone on the input prior to stringification.