Skip to content

Commit

Permalink
fix: Log DOM transform error so it doesn't end up as [Object object] (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Robdel12 authored Mar 4, 2020
1 parent 0196626 commit 1757bf0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/percy-agent-client/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class DOM {
try {
dom = this.options.domTransformation(dom)
} catch (error) {
console.error('Could not transform the dom: ', error)
console.error('Could not transform the dom:')
console.error(error)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/percy-agent-client/dom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('DOM -', () => {
expect(consoleStub.called).to.equal(false)
// invoke the transform function again to try and remove a non-existent element
expect(dom.snapshotString()).to.contain('Hello DOM testing')
expect(consoleStub.calledOnce).to.equal(true)
expect(consoleStub.calledTwice).to.equal(true)
})
})

Expand Down

0 comments on commit 1757bf0

Please sign in to comment.