You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When asserting frozen objects in WTR, the test-file never finishes according to the cli.
Here is a test-case:
import{expect}from'@open-wc/testing';describe('readonly',()=>{it('gets stuck when throwing readonly array of objects',()=>{constobj=[{}];constfrozenObj=Object.freeze(obj);expect(frozenObj).to.be.empty;});})
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.
The text was updated successfully, but these errors were encountered: