diff --git a/src/core.js b/src/core.js index 325f9f02..82d3d684 100644 --- a/src/core.js +++ b/src/core.js @@ -62,7 +62,7 @@ function callPenthouse(document, options) { } if (user && pass) { - config.customPageHeaders = {...customPageHeaders, Authorization: 'Basic ' + token(user, pass)}; + config.customPageHeaders = {...customPageHeaders, Authorization: `Basic ${token(user, pass)}`}; } return sizes.map(({width, height}) => () => { @@ -211,7 +211,7 @@ async function create(options = {}) { const uncriticalHref = normalizePath(path.relative(document.cwd, path.resolve(base, target.uncritical))); // Only replace stylesheets if the uncriticalHref is inside document.cwd and replaceStylesheets is not set via options if (!/^\.\.\//.test(uncriticalHref) && replaceStylesheets === undefined) { - inline.replaceStylesheets = ['/' + uncriticalHref]; + inline.replaceStylesheets = [`/${uncriticalHref}`]; } } else { inline.extract = extract; diff --git a/src/file.js b/src/file.js index 1cdcb08a..c8b306ef 100644 --- a/src/file.js +++ b/src/file.js @@ -306,7 +306,7 @@ async function fetch(uri, options = {}, secure = true) { request.rejectUnauthorized = false; if (user && pass) { - headers.Authorization = 'Basic ' + token(user, pass); + headers.Authorization = `Basic ${token(user, pass)}`; } if (userAgent) { diff --git a/test/blackbox.test.js b/test/blackbox.test.js index 50e57105..ba3da521 100644 --- a/test/blackbox.test.js +++ b/test/blackbox.test.js @@ -16,7 +16,7 @@ jest.setTimeout(60000); process.chdir(path.resolve(__dirname)); function assertCritical(target, expected, done, skipTarget) { - return function(err, {css, html} = {}) { + return (err, {css, html} = {}) => { const output = /\.css$/.test(target) ? css : html; if (err) { diff --git a/test/file.test.js b/test/file.test.js index c167559a..f9c8201e 100644 --- a/test/file.test.js +++ b/test/file.test.js @@ -359,7 +359,7 @@ test('Get document from source with rebase option', async () => { // expect.assertions(tests.length + 1); for (const testdata of tests) { const {filepath, expected} = testdata; - const rebase = {to: '/' + normalizePath(path.relative(base, filepath))}; + const rebase = {to: `/${normalizePath(path.relative(base, filepath))}`}; const source = await fs.readFile(filepath); const file = await getDocumentFromSource(source, {rebase, base}); expect(file.virtualPath).toBe(expected);