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

Run tests in headless browser framework? #123

Open
adroitwhiz opened this issue Mar 27, 2020 · 0 comments
Open

Run tests in headless browser framework? #123

adroitwhiz opened this issue Mar 27, 2020 · 0 comments

Comments

@adroitwhiz
Copy link
Contributor

adroitwhiz commented Mar 27, 2020

Expected Behavior...

...should be easy to verify via tests.

Actual Behavior

...could differ significantly between Node + JSDOM, which is where tests are currently run, and the browser, which is where the SVG renderer is used.

The SVG renderer uses a significant number of DOM functions which are out of the scope of what JSDOM emulates-- for instance, the SvgRenderer constructor calls HTMLCanvasElement.getContext, and measuring an SVG requires calling getBBox.

In order to test those parts of the API, those functions must work properly, which requires running tests inside a browser.

I ran into this when writing tests for #85, which required a lot of shimming.

Adding in-browser testing support may also help with #119.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants