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

Fix the detection of epub:type-based page markers + Run script tests in headless Chrome #100

Merged
merged 3 commits into from
Oct 28, 2017

Conversation

rdeltour
Copy link
Member

  • Introduce a new Jest environment to run tests in headless Chrome (via [Puppeteer](git push --set-upstream origin fix/haspagebreaks))
  • Closes page breaks not detected? #85

- introduce a new util module `puppetter-utils`
- the mode contains an `addScripts` function to inject script paths to a browser page,
  annotating the inserted script elements with the `data-ace` attribute.
- refactor `checker-chromium` to inject the scripts using this new method. The scripts
  inserted by Ace are now defined in a single array, easier to read and configure.
The tests for the browser scripts were previously run in a virtual
DOM (within Jest’s JDOM environment). This commit introduces a new
Jest environment (and companion utils) to run tests in a full browser
environment (headless Chrome, driven by Puppeteer).

Jest’s mock facility is available in the browser context through the
`window.mock` object.
@rdeltour rdeltour merged commit 72e5bd5 into master Oct 28, 2017
@rdeltour rdeltour deleted the fix/haspagebreaks branch October 28, 2017 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

page breaks not detected?
1 participant