Skip to content

Commit

Permalink
Merge 850e955 into d3a9e86
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Oct 28, 2018
2 parents d3a9e86 + 850e955 commit 74041a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions test/index.spec.js
Expand Up @@ -13,7 +13,7 @@ expect.addAssertion('<any> to inspect as itself', (expect, subject) => {
const originalSubject = subject;
if (typeof subject === 'string') {
subject = new jsdom.JSDOM(
'<!DOCTYPE html><html><head></head><body>' + subject + '</body></html>'
`<!DOCTYPE html><html><head></head><body>${subject}</body></html>`
).window.document.body.firstChild;
}
if (typeof originalSubject === 'string') {
Expand All @@ -30,7 +30,7 @@ expect.addAssertion(
(expect, subject, value) => {
if (typeof subject === 'string') {
subject = new jsdom.JSDOM(
'<!DOCTYPE html><html><head></head><body>' + subject + '</body></html>'
`<!DOCTYPE html><html><head></head><body>${subject}</body></html>`
).window.document.body.firstChild;
}
expect(expect.inspect(subject).toString(), 'to equal', value);
Expand All @@ -45,9 +45,7 @@ expect.addAssertion(
item =>
typeof item === 'string'
? new jsdom.JSDOM(
'<!DOCTYPE html><html><head></head><body>' +
item +
'</body></html>'
`<!DOCTYPE html><html><head></head><body>${item}</body></html>`
).window.document.body.firstChild
: item
);
Expand All @@ -60,7 +58,7 @@ expect.addAssertion(
);

function parseHtml(str) {
return new jsdom.JSDOM('<!DOCTYPE html><html><body>' + str + '</body></html>')
return new jsdom.JSDOM(`<!DOCTYPE html><html><body>${str}</body></html>`)
.window.document.body.firstChild;
}

Expand All @@ -69,7 +67,7 @@ function parseHtmlDocument(str) {
}

function parseHtmlFragment(str) {
str = '<html><head></head><body>' + str + '</body></html>';
str = `<html><head></head><body>${str}</body></html>`;
const htmlDocument = new jsdom.JSDOM(str).window.document;
const body = htmlDocument.body;
const documentFragment = htmlDocument.createDocumentFragment();
Expand Down
2 changes: 1 addition & 1 deletion test/jsdom-compatibility.js
Expand Up @@ -10,7 +10,7 @@ expect.addAssertion('to inspect as [itself]', function(expect, subject, value) {
const originalSubject = subject;
if (typeof subject === 'string') {
subject = new jsdom.JSDOM(
'<!DOCTYPE html><html><head></head><body>' + subject + '</body></html>'
`<!DOCTYPE html><html><head></head><body>${subject}</body></html>`
).window.document.body.firstChild;
}
if (this.flags.itself) {
Expand Down

0 comments on commit 74041a2

Please sign in to comment.