Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up a test framework to create and run unit and integration tests #10

Open
0xedward opened this issue Jul 7, 2021 · 1 comment
Open
Assignees
Labels
help wanted Extra attention is needed infra

Comments

@0xedward
Copy link
Collaborator

0xedward commented Jul 7, 2021

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

@0xedward 0xedward changed the title Set up a test framework to create unit and integration tests Set up a test framework to create and run unit and integration tests Jul 7, 2021
@0xedward
Copy link
Collaborator Author

0xedward commented Jul 11, 2021

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.

0xedward added a commit to 0xedward/sanitizer-polyfill that referenced this issue Jul 11, 2021
mozfreddyb pushed a commit that referenced this issue Jul 12, 2021
@mozfreddyb mozfreddyb added infra help wanted Extra attention is needed labels Aug 2, 2021
@0xedward 0xedward self-assigned this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed infra
Projects
None yet
Development

No branches or pull requests

2 participants