Closed dgitin closed 1 year ago
Metric | Coverage Percent | Covered / Total |
---|---|---|
Statements | 80.75% | ( 822/1018 ) |
Branches | 61.24% | ( 256/418 ) |
Functions | 72.48% | ( 79/109 ) |
Lines | 80.49% | ( 792/984 ) |
Total | 73.74% |
thanks for making these changes. can we add some tests for this?
Testing is problematic there is absolutely nothing set up at the moment to support this scenario. First, there is no policy to assert on in the virtual environment because the entire trustedTypes object gets remapped. Second, testing with Trusted Types is quite the challenge on this repo, the code needs to load once, declare the policies and then assert that evaluation is possible in the environment but not in the main window which would confirm that virtual environment run with their own TT policy. So definitely not as simple as just writing a test. The test is easy, the setting up, quite the opposite.
The policy needs to be declared as being part of this window, not distorted. Once things are remapped declaring a default policy in the virtual env becomes a problem so if you know a more elegant way of achieving the same result I'd like to know about it.