sanitizer-polyfill
sanitizer-polyfill copied to clipboard
Set up a test framework to create and run unit and integration tests
As of right now, we will need to write unit tests for functions in src/sanitizer.js and integration tests for Sanitizer methods.
We might be able to draw inspiration from the testing setup and the test cases in DOMPurify
Copying from tests/TODO:
ideally:
- clone wpt from https://github.com/web-platform-tests/wpt
- open a browser that is configured to run wpt
- figure out how to execute the polyfill on every site
- run the wpt tests for the sanitizer-api subfolder
Note: it looks like the trusted-types repo is doing that at https://github.com/w3c/webappsec-trusted-types/tree/main/tests/platform-tests
practically (short term)
- clone test cases from https://github.com/web-platform-tests/wpt/blob/master/sanitizer-api/support/testcases.sub.js
- DIY test-framework that uses the test cases, start with sanitize() function only.