Skip to content

Commit

Permalink
Merge pull request #17 from Connexions/add-codecov
Browse files Browse the repository at this point in the history
add codecov
  • Loading branch information
philschatz authored Jul 2, 2018
2 parents 5f60bbf + 0b26bc1 commit 11bd200
Show file tree
Hide file tree
Showing 5 changed files with 219 additions and 200 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ sudo: false
language: node_js
node_js:
- "8"
install:
- npm install -g codecov
- npm install
script:
- npm run-script test
- codecov
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"jest": "^23.2.0",
"standard": "^11.0.1"
},
"jest": {
"coverageDirectory": "./coverage/",
"collectCoverage": true
},
"standard": {
"env": [
"jest"
Expand Down
10 changes: 5 additions & 5 deletions typeset/converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const injectMathJax = async (log, inputPath, cssPath, outputPath, mathJaxPath) =
})
log.debug(`Opened "${url}"`)

await page.evaluate(() => {
await page.evaluate(/* istanbul ignore next */() => {
window.__TYPESET_CONFIG = {
isDone: false,
isFailed: false,
Expand All @@ -83,7 +83,7 @@ const injectMathJax = async (log, inputPath, cssPath, outputPath, mathJaxPath) =
})

log.debug(`Injecting CSS...`)
await page.evaluate(stylePath => {
await page.evaluate(/* istanbul ignore next */stylePath => {
if (stylePath) {
console.log('Setting stylesheets...')
const style = document.createElement('link')
Expand All @@ -108,7 +108,7 @@ const injectMathJax = async (log, inputPath, cssPath, outputPath, mathJaxPath) =

// Typeset equations
log.info(`Injecting MathJax (and typesetting)...`)
const didMathJaxLoad = await page.evaluate((mathJaxPath) => {
const didMathJaxLoad = await page.evaluate(/* istanbul ignore next */(mathJaxPath) => {
console.log('Setting config for MathJax...')
const MATHJAX_CONFIG = {
extensions: ['mml2jax.js', 'MatchWebFonts.js'],
Expand Down Expand Up @@ -187,7 +187,7 @@ const injectMathJax = async (log, inputPath, cssPath, outputPath, mathJaxPath) =
log.info(`Polling to see when MathJax is done typesetting...`)
let pageContentAfterSerialize = ''
while (true) {
const {isFailed, isDone} = await page.evaluate(() => {
const {isFailed, isDone} = await page.evaluate(/* istanbul ignore next */() => {
if (!window.MathJax) {
console.error('MathJax was not loaded')
return {isFailed: true}
Expand All @@ -207,7 +207,7 @@ const injectMathJax = async (log, inputPath, cssPath, outputPath, mathJaxPath) =
return STATUS_CODE.ERROR
} else if (isDone) {
log.info('Serializing document...')
pageContentAfterSerialize = await page.evaluate(() => {
pageContentAfterSerialize = await page.evaluate(/* istanbul ignore next */() => {
// Remove any elements we added
window.__TYPESET_CONFIG.elementsToRemove.forEach(el => el.remove())

Expand Down
Loading

0 comments on commit 11bd200

Please sign in to comment.