diff --git a/.eslintrc.json b/.eslintrc.json index d62c87eb14..fb69bc6b0b 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -13,7 +13,10 @@ "prettier/prettier": [ "error", { - "singleQuote": true + "singleQuote": true, + "trailingComma": "none", + "arrowParens": "avoid", + "embeddedLanguageFormatting": "off" } ], "no-extra-semi": "off", diff --git a/bin/browsertime.js b/bin/browsertime.js index 9d5fe7aa35..3d1a9a4eb5 100755 --- a/bin/browsertime.js +++ b/bin/browsertime.js @@ -11,7 +11,7 @@ const fs = require('fs'); const path = require('path'); const log = require('intel').getLogger('browsertime'); const engineUtils = require('../lib/support/engineUtils'); -const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor; +const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor; const delay = ms => new Promise(res => setTimeout(res, ms)); async function parseUserScripts(scripts) { diff --git a/lib/android/index.js b/lib/android/index.js index 8f722142bc..fe542ecdbc 100644 --- a/lib/android/index.js +++ b/lib/android/index.js @@ -91,7 +91,7 @@ class Android { const transfer = await this.client.pull(this.id, sourcePath); return new Promise((resolve, reject) => { - transfer.on('end', function() { + transfer.on('end', function () { resolve(); }); transfer.on('error', reject); diff --git a/lib/chrome/har.js b/lib/chrome/har.js index 7781e6c74b..d0ede7ae24 100644 --- a/lib/chrome/har.js +++ b/lib/chrome/har.js @@ -5,7 +5,7 @@ const perflogParser = require('chrome-har'); const harBuilder = require('../support/har'); const { Type } = require('selenium-webdriver').logging; -module.exports = async function( +module.exports = async function ( runner, result, index, @@ -38,9 +38,9 @@ module.exports = async function( await cdpClient.setResponseBodies(har); } - const versionInfo = (await cdpClient.send( - 'Browser.getVersion' - )).product.split('/'); + const versionInfo = ( + await cdpClient.send('Browser.getVersion') + ).product.split('/'); const info = { name: versionInfo[0], version: versionInfo[1] diff --git a/lib/chrome/longTaskMetrics.js b/lib/chrome/longTaskMetrics.js index 0a8cc30e1e..e5d4da8f13 100644 --- a/lib/chrome/longTaskMetrics.js +++ b/lib/chrome/longTaskMetrics.js @@ -2,7 +2,7 @@ const get = require('lodash.get'); -module.exports = function(result, options) { +module.exports = function (result, options) { let totalDurationFirstPaint = 0; let totalDurationFirstContentFulPaint = 0; let totalDurationAfterLoadEventEnd = 0; diff --git a/lib/chrome/speedline.js b/lib/chrome/speedline.js index 662737fab9..bd9b3183b3 100644 --- a/lib/chrome/speedline.js +++ b/lib/chrome/speedline.js @@ -18,13 +18,13 @@ function pad(n) { * Use SpeedLine to analyse the Chrome trace log to get Visual Metrics. * Not as good as using a video but maybe usable in some cases. */ -module.exports = async function(trace, result, index) { +module.exports = async function (trace, result, index) { try { const navStart = trace.traceEvents.filter( task => task.cat === 'blink.user_timing' && task.name === 'navigationStart' ); - navStart.sort(function(a, b) { + navStart.sort(function (a, b) { return a.ts - b.ts; }); log.debug('Get Speedline result from the trace'); diff --git a/lib/chrome/webdriver/builder.js b/lib/chrome/webdriver/builder.js index 5bcb322071..c4a242b7f0 100644 --- a/lib/chrome/webdriver/builder.js +++ b/lib/chrome/webdriver/builder.js @@ -14,7 +14,7 @@ let hasConfiguredChromeDriverService = false; * @param builder * @param {Object} options the options for a web driver. */ -module.exports.configureBuilder = function(builder, baseDir, options) { +module.exports.configureBuilder = function (builder, baseDir, options) { const chromeConfig = options.chrome || {}; if (!hasConfiguredChromeDriverService) { diff --git a/lib/chrome/webdriver/setupChromiumOptions.js b/lib/chrome/webdriver/setupChromiumOptions.js index 48cd5563e4..4008fe5780 100644 --- a/lib/chrome/webdriver/setupChromiumOptions.js +++ b/lib/chrome/webdriver/setupChromiumOptions.js @@ -5,7 +5,7 @@ const getViewPort = require('../../support/getViewPort'); const util = require('../../support/util'); const log = require('intel').getLogger('browsertime.chrome'); -module.exports = function(seleniumOptions, browserOptions, options, baseDir) { +module.exports = function (seleniumOptions, browserOptions, options, baseDir) { // Fixing save password popup, only on Desktop if (!options.android) { seleniumOptions.setUserPreferences({ diff --git a/lib/connectivity/trafficShapeParser.js b/lib/connectivity/trafficShapeParser.js index 0033f96cc3..63f123e1e7 100644 --- a/lib/connectivity/trafficShapeParser.js +++ b/lib/connectivity/trafficShapeParser.js @@ -104,7 +104,7 @@ const legacyProfiles = { }; module.exports = { - parseTrafficShapeConfig: function(options) { + parseTrafficShapeConfig: function (options) { if (options.connectivity && options.connectivity.profile === 'custom') { return { down: options.connectivity.down, @@ -133,7 +133,7 @@ module.exports = { return null; } }, - getProfiles: function() { + getProfiles: function () { return newProfiles; } }; diff --git a/lib/connectivity/tsProxy.js b/lib/connectivity/tsProxy.js index 7435658c72..908072658d 100644 --- a/lib/connectivity/tsProxy.js +++ b/lib/connectivity/tsProxy.js @@ -14,7 +14,7 @@ const TS_PROXY_SCRIPT_PATH = path.join( ); function getStartupCriteriaListener(resolve, reject) { - return function(data) { + return function (data) { const logLine = data.toString(); if (logLine.startsWith('Started Socks5 proxy server on')) { log.debug('Started TSproxy'); @@ -65,12 +65,12 @@ class TSProxy { const tsProxyProcess = this.tsProxyProcess; if (this.logVerbose) { - tsProxyProcess.stderr.on('data', function(data) { + tsProxyProcess.stderr.on('data', function (data) { log.verbose(data.toString().trim()); }); } - return new Promise(function(resolve, reject) { + return new Promise(function (resolve, reject) { tsProxyProcess.stdout.on( 'data', getStartupCriteriaListener(resolve, reject) diff --git a/lib/core/engine/command/measure.js b/lib/core/engine/command/measure.js index 747d507c69..801c34c16f 100644 --- a/lib/core/engine/command/measure.js +++ b/lib/core/engine/command/measure.js @@ -261,14 +261,12 @@ class Measure { // we also need to add that to the meta data so that the correct folder is created if (this.result[this.numberOfMeasuredPages].alias) { if (this.options.urlMetaData) { - this.options.urlMetaData[url] = this.result[ - this.numberOfMeasuredPages - ].alias; + this.options.urlMetaData[url] = + this.result[this.numberOfMeasuredPages].alias; } else { this.options.urlMetaData = {}; - this.options.urlMetaData[url] = this.result[ - this.numberOfMeasuredPages - ].alias; + this.options.urlMetaData[url] = + this.result[this.numberOfMeasuredPages].alias; } } diff --git a/lib/core/engine/command/mouse/clickAndHold.js b/lib/core/engine/command/mouse/clickAndHold.js index 228c153a95..b73cf053ae 100644 --- a/lib/core/engine/command/mouse/clickAndHold.js +++ b/lib/core/engine/command/mouse/clickAndHold.js @@ -18,10 +18,7 @@ class ClickAndHold { async byXpath(xpath) { try { const element = await this.driver.findElement(webdriver.By.xpath(xpath)); - return this.actions - .move({ origin: element }) - .press() - .perform(); + return this.actions.move({ origin: element }).press().perform(); } catch (e) { log.error('Could not click and hold on element with xpath %s', xpath); log.verbose(e); @@ -38,10 +35,7 @@ class ClickAndHold { async bySelector(selector) { try { const element = await this.driver.findElement(webdriver.By.css(selector)); - return this.actions - .move({ origin: element }) - .press() - .perform(); + return this.actions.move({ origin: element }).press().perform(); } catch (e) { log.error( 'Could not click and hold on element with selector %s', @@ -103,10 +97,7 @@ class ClickAndHold { async releaseAtXpath(xpath) { try { const element = await this.driver.findElement(webdriver.By.xpath(xpath)); - return this.actions - .move({ origin: element }) - .release() - .perform(); + return this.actions.move({ origin: element }).release().perform(); } catch (e) { log.error('Could not release on xpath %s', xpath); log.verbose(e); @@ -123,10 +114,7 @@ class ClickAndHold { async releaseAtSelector(selector) { try { const element = await this.driver.findElement(webdriver.By.css(selector)); - return this.actions - .move({ origin: element }) - .release() - .perform(); + return this.actions.move({ origin: element }).release().perform(); } catch (e) { log.error('Could not release on selector %s', selector); log.verbose(e); diff --git a/lib/core/engine/command/switch.js b/lib/core/engine/command/switch.js index 174455ec2f..d63a0d9b21 100644 --- a/lib/core/engine/command/switch.js +++ b/lib/core/engine/command/switch.js @@ -58,10 +58,7 @@ class Switch { */ async toNewTab(url) { try { - await this.browser - .getDriver() - .switchTo() - .newWindow('tab'); + await this.browser.getDriver().switchTo().newWindow('tab'); if (url) { await this.navigate(url); await this.browser.extraWait(this.pageCompleteCheck); @@ -80,10 +77,7 @@ class Switch { */ async toNewWindow(url) { try { - await this.browser - .getDriver() - .switchTo() - .newWindow('window'); + await this.browser.getDriver().switchTo().newWindow('window'); if (url) { await this.navigate(url); await this.browser.extraWait(this.pageCompleteCheck); diff --git a/lib/core/engine/iteration.js b/lib/core/engine/iteration.js index 258aba6403..e01f4f13dd 100644 --- a/lib/core/engine/iteration.js +++ b/lib/core/engine/iteration.js @@ -262,11 +262,10 @@ class Iteration { 'PerceptualSpeedIndexProgress' ]) { if (videoMetrics.visualMetrics[progress]) { - videoMetrics.visualMetrics[ - progress - ] = util.jsonifyVisualProgress( - videoMetrics.visualMetrics[progress] - ); + videoMetrics.visualMetrics[progress] = + util.jsonifyVisualProgress( + videoMetrics.visualMetrics[progress] + ); } } result[i].videoRecordingStart = videoMetrics.videoRecordingStart; diff --git a/lib/core/engine/run.js b/lib/core/engine/run.js index 8ec431c4b5..fcd27ee77c 100644 --- a/lib/core/engine/run.js +++ b/lib/core/engine/run.js @@ -1,7 +1,7 @@ 'use strict'; -module.exports = function(urlOrFunctions) { - return async function(context, commands) { +module.exports = function (urlOrFunctions) { + return async function (context, commands) { for (let urlOrFunction of urlOrFunctions) { if (typeof urlOrFunction === 'function') { await urlOrFunction(context, commands); diff --git a/lib/core/seleniumRunner.js b/lib/core/seleniumRunner.js index fdcd4c36cc..b8fbea70dd 100644 --- a/lib/core/seleniumRunner.js +++ b/lib/core/seleniumRunner.js @@ -70,8 +70,9 @@ class SeleniumRunner { this.driver = await timeout( builder.createWebDriver(this.baseDir, this.options), this.options.timeouts.browserStart, - `Failed to start ${this.options.browser} in ${this.options.timeouts - .browserStart / 1000} seconds.` + `Failed to start ${this.options.browser} in ${ + this.options.timeouts.browserStart / 1000 + } seconds.` ); break; } catch (e) { @@ -85,9 +86,9 @@ class SeleniumRunner { throw e; } else { log.info( - `${this.options.browser} failed to start, trying ${tries - - i - - 1} more time(s): ${e.message}` + `${this.options.browser} failed to start, trying ${ + tries - i - 1 + } more time(s): ${e.message}` ); } } @@ -167,11 +168,13 @@ class SeleniumRunner { try { const pageCompleteCheckCondition = new Condition( 'for page complete check script to return true', - function(d) { - return d.executeScript(pageCompleteCheck, waitTime).then(function(t) { - log.verbose('PageCompleteCheck returned %s', t); - return t === true; - }); + function (d) { + return d + .executeScript(pageCompleteCheck, waitTime) + .then(function (t) { + log.verbose('PageCompleteCheck returned %s', t); + return t === true; + }); } ); log.debug( @@ -297,9 +300,9 @@ class SeleniumRunner { log.info( `URL ${url} failed to load, the ${ this.options.browser - } are still on ${startURI} , trying ${tries - - i - - 1} more time(s) but first wait for ${waitTime} ms.` + } are still on ${startURI} , trying ${ + tries - i - 1 + } more time(s) but first wait for ${waitTime} ms.` ); if (i === tries - 1) { @@ -476,13 +479,11 @@ class SeleniumRunner { */ async getLogs(logType) { return timeout( - this.driver - .manage() - .logs() - .get(logType), + this.driver.manage().logs().get(logType), this.options.timeouts.logs, - `Extracting logs from ${this.options.browser} took more than ${this - .options.timeouts.logs / 1000} seconds.` + `Extracting logs from ${this.options.browser} took more than ${ + this.options.timeouts.logs / 1000 + } seconds.` ); } @@ -626,9 +627,9 @@ class SeleniumRunner { if (!script) { let func = category[scriptName].function; if (!func) { - throw 'Function and script cannot both be null in ' + - scriptName + - '.'; + throw ( + 'Function and script cannot both be null in ' + scriptName + '.' + ); } // We wrap the source code of the function in parenthesis // "(...)" to contain it in a separate scope. We add a diff --git a/lib/core/webdriver/index.js b/lib/core/webdriver/index.js index e692a015d2..762c9c849c 100644 --- a/lib/core/webdriver/index.js +++ b/lib/core/webdriver/index.js @@ -13,7 +13,7 @@ const safari = require('../../safari/webdriver/builder'); * @returns {!Promise} a promise that resolves to the webdriver, * or rejects if the current configuration is invalid. */ -module.exports.createWebDriver = async function(baseDir, options) { +module.exports.createWebDriver = async function (baseDir, options) { const browser = options.browser || 'chrome'; const seleniumUrl = options.selenium ? options.selenium.url : undefined; const capabilities = options.selenium diff --git a/lib/edge/webdriver/builder.js b/lib/edge/webdriver/builder.js index 0f9d07e7c5..80f2121d16 100644 --- a/lib/edge/webdriver/builder.js +++ b/lib/edge/webdriver/builder.js @@ -7,7 +7,7 @@ const isEmpty = require('lodash.isempty'); const webdriver = require('selenium-webdriver'); const setupChromiumOptions = require('../../chrome/webdriver/setupChromiumOptions'); -module.exports.configureBuilder = function(builder, baseDir, options) { +module.exports.configureBuilder = function (builder, baseDir, options) { const edgeConfig = options.edge || {}; const chromeConfig = options.chrome || {}; diff --git a/lib/extensionserver/setup.js b/lib/extensionserver/setup.js index 0d316802f9..155cad1dc3 100644 --- a/lib/extensionserver/setup.js +++ b/lib/extensionserver/setup.js @@ -46,7 +46,7 @@ function generateURL(port, testUrl, options) { }); } -module.exports = async function(url, browser, port, options) { +module.exports = async function (url, browser, port, options) { const configUrl = generateURL(port, url, options); log.debug('Configuring browser plugin via %s', configUrl); await browser.loadAndWait(configUrl); diff --git a/lib/firefox/geckoProfiler.js b/lib/firefox/geckoProfiler.js index 9a0c9721b6..c79132f354 100644 --- a/lib/firefox/geckoProfiler.js +++ b/lib/firefox/geckoProfiler.js @@ -40,9 +40,8 @@ class GeckoProfiler { const runner = this.runner; const firefoxConfig = this.firefoxConfig; const options = this.options; - const chosenFeatures = firefoxConfig.geckoProfilerParams.features.split( - ',' - ); + const chosenFeatures = + firefoxConfig.geckoProfilerParams.features.split(','); const featureString = '["' + chosenFeatures.join('","') + '"]'; const chosenThreads = firefoxConfig.geckoProfilerParams.threads.split(','); diff --git a/lib/firefox/getHAR.js b/lib/firefox/getHAR.js index cb0cd094b3..2c4fc6f04f 100644 --- a/lib/firefox/getHAR.js +++ b/lib/firefox/getHAR.js @@ -4,7 +4,7 @@ const log = require('intel').getLogger('browsertime.firefox'); // Get the HAR from Firefox // Using https://github.com/firefox-devtools/har-export-trigger -module.exports = async function(runner, includeResponseBodies) { +module.exports = async function (runner, includeResponseBodies) { const script = ` const callback = arguments[arguments.length - 1]; async function triggerExport() { diff --git a/lib/firefox/webdriver/builder.js b/lib/firefox/webdriver/builder.js index 820ba209f3..69c38076ce 100644 --- a/lib/firefox/webdriver/builder.js +++ b/lib/firefox/webdriver/builder.js @@ -13,7 +13,7 @@ const disableTrackingProtectionPreferences = require('../settings/disableTrackin const util = require('../../support/util'); const { Android } = require('../../android'); -module.exports.configureBuilder = function(builder, baseDir, options) { +module.exports.configureBuilder = function (builder, baseDir, options) { // Here we configure everything that we need to start Firefox const firefoxConfig = options.firefox || {}; const moduleRootPath = path.resolve(__dirname, '..', '..', '..'); @@ -84,7 +84,7 @@ module.exports.configureBuilder = function(builder, baseDir, options) { } if (!firefoxConfig.noDefaultPrefs) { - Object.keys(defaultFirefoxPreferences).forEach(function(pref) { + Object.keys(defaultFirefoxPreferences).forEach(function (pref) { ffOptions.setPreference(pref, defaultFirefoxPreferences[pref]); }); } else { @@ -92,13 +92,13 @@ module.exports.configureBuilder = function(builder, baseDir, options) { } if (firefoxConfig.disableSafeBrowsing) { - Object.keys(disableSafeBrowsingPreferences).forEach(function(pref) { + Object.keys(disableSafeBrowsingPreferences).forEach(function (pref) { ffOptions.setPreference(pref, disableSafeBrowsingPreferences[pref]); }); } if (firefoxConfig.disableTrackingProtection) { - Object.keys(disableTrackingProtectionPreferences).forEach(function(pref) { + Object.keys(disableTrackingProtectionPreferences).forEach(function (pref) { ffOptions.setPreference(pref, disableTrackingProtectionPreferences[pref]); }); } @@ -167,7 +167,7 @@ module.exports.configureBuilder = function(builder, baseDir, options) { get(firefoxConfig, 'developer') ? firefox.Channel.AURORA : undefined ]; - firefoxTypes = firefoxTypes.filter(function(n) { + firefoxTypes = firefoxTypes.filter(function (n) { return n !== undefined; }); diff --git a/lib/firefox/webdriver/firefox.js b/lib/firefox/webdriver/firefox.js index 0063a0b671..35745a1c63 100644 --- a/lib/firefox/webdriver/firefox.js +++ b/lib/firefox/webdriver/firefox.js @@ -206,13 +206,12 @@ class Firefox { ]) { // You can configure to not use content and perceptual. if (results[i].visualMetrics[progress]) { - results[i].visualMetrics[ - progress - ] = util.adjustVisualProgressTimestamps( - results[i].visualMetrics[progress], - geckoProfile.meta.startTime, - firstFrameStartTime - ); + results[i].visualMetrics[progress] = + util.adjustVisualProgressTimestamps( + results[i].visualMetrics[progress], + geckoProfile.meta.startTime, + firstFrameStartTime + ); } } geckoProfile.meta.visualMetrics = results[i].visualMetrics; diff --git a/lib/safari/webdriver/builder.js b/lib/safari/webdriver/builder.js index a92c27fafd..8b893911b6 100644 --- a/lib/safari/webdriver/builder.js +++ b/lib/safari/webdriver/builder.js @@ -1,7 +1,7 @@ 'use strict'; const s = require('selenium-webdriver/safari'); -module.exports.configureBuilder = async function(builder, baseDir, options) { +module.exports.configureBuilder = async function (builder, baseDir, options) { const safariOptions = options.safari || {}; builder .getCapabilities() diff --git a/lib/support/browserScript.js b/lib/support/browserScript.js index d43f27ea18..6b62f5d112 100644 --- a/lib/support/browserScript.js +++ b/lib/support/browserScript.js @@ -80,7 +80,7 @@ function generateScriptObject(name, path, contents) { content: null, isAsync: Object.getPrototypeOf(scriptAndMetadataObject.function) === - Object.getPrototypeOf(async function() {}) + Object.getPrototypeOf(async function () {}) }; } } catch (error) { diff --git a/lib/support/engineUtils.js b/lib/support/engineUtils.js index de1b754311..0533fcd949 100644 --- a/lib/support/engineUtils.js +++ b/lib/support/engineUtils.js @@ -4,7 +4,7 @@ const path = require('path'); const dayjs = require('dayjs'); const util = require('../support/util'); const log = require('intel').getLogger('browsertime'); -const AsyncFunction = Object.getPrototypeOf(async function() {}).constructor; +const AsyncFunction = Object.getPrototypeOf(async function () {}).constructor; module.exports = { loadPrePostScripts(scripts) { diff --git a/lib/support/getViewPort.js b/lib/support/getViewPort.js index 4c75ea615c..87ee3d371b 100644 --- a/lib/support/getViewPort.js +++ b/lib/support/getViewPort.js @@ -25,7 +25,7 @@ const sizeMap = { 'iPad Pro': '1024x1366' }; -module.exports = function(options) { +module.exports = function (options) { // you cannot set the width/height for phone so just keep the viewport undefined if (isAndroidConfigured(options)) { return; diff --git a/lib/support/har/index.js b/lib/support/har/index.js index 717bb13c46..1a56502f91 100644 --- a/lib/support/har/index.js +++ b/lib/support/har/index.js @@ -97,20 +97,19 @@ function addMetaToHAR(index, harPage, url, browserScript, options) { ? options.resultURL : options.resultURL + '/'; if (options.screenshot) { - _meta.screenshot = `${base}${pathToFolder( - url, - options - )}screenshots/${index + 1}/afterPageCompleteCheck.${ - options.screenshotParams.type - }`; + _meta.screenshot = `${base}${pathToFolder(url, options)}screenshots/${ + index + 1 + }/afterPageCompleteCheck.${options.screenshotParams.type}`; } if (options.video) { - _meta.video = `${base}${pathToFolder(url, options)}video/${index + - 1}.mp4`; + _meta.video = `${base}${pathToFolder(url, options)}video/${ + index + 1 + }.mp4`; } if (options.chrome && options.chrome.timeline) { - _meta.timeline = `${base}${pathToFolder(url, options)}trace-${index + - 1}.json.gz`; + _meta.timeline = `${base}${pathToFolder(url, options)}trace-${ + index + 1 + }.json.gz`; } } if (browserScript && browserScript.pageinfo) { @@ -129,7 +128,7 @@ function jsonifyVisualProgress(visualProgress) { } module.exports = { - addBrowser: function(har, name, version, comment) { + addBrowser: function (har, name, version, comment) { merge(har.log, { browser: { name, @@ -145,7 +144,7 @@ module.exports = { return har; }, - addCreator: function(har, comment) { + addCreator: function (har, comment) { merge(har.log, { creator: { name: 'Browsertime', @@ -161,7 +160,7 @@ module.exports = { return har; }, - getFullyLoaded: function(har) { + getFullyLoaded: function (har) { const fullyLoaded = []; const entries = Array.from(har.log.entries); @@ -190,7 +189,7 @@ module.exports = { return fullyLoaded; }, - mergeHars: function(hars) { + mergeHars: function (hars) { if (isEmpty(hars)) { return undefined; } diff --git a/lib/support/pathToFolder.js b/lib/support/pathToFolder.js index 486c12bd2d..b71b17c0d5 100644 --- a/lib/support/pathToFolder.js +++ b/lib/support/pathToFolder.js @@ -10,7 +10,7 @@ function toSafeKey(key) { return key.replace(/[.~ /+|,:?&%–)(]|%7C/g, '-'); } -module.exports = function(url, options) { +module.exports = function (url, options) { if (options.useSameDir) { return ''; } else { @@ -31,19 +31,13 @@ module.exports = function(url, options) { if (useHash && !isEmpty(parsedUrl.hash)) { const md5 = crypto.createHash('md5'), - hash = md5 - .update(parsedUrl.hash) - .digest('hex') - .substring(0, 8); + hash = md5.update(parsedUrl.hash).digest('hex').substring(0, 8); urlSegments.push('hash-' + hash); } if (!isEmpty(parsedUrl.search)) { const md5 = crypto.createHash('md5'), - hash = md5 - .update(parsedUrl.search) - .digest('hex') - .substring(0, 8); + hash = md5.update(parsedUrl.search).digest('hex').substring(0, 8); urlSegments.push('query-' + hash); } @@ -65,7 +59,7 @@ module.exports = function(url, options) { pathSegments.push('data'); - pathSegments.forEach(function(segment, index) { + pathSegments.forEach(function (segment, index) { if (segment) { pathSegments[index] = segment.replace( /[^-a-z0-9_.\u0621-\u064A]/gi, diff --git a/lib/support/preURL.js b/lib/support/preURL.js index 4028de1549..ddb9350192 100644 --- a/lib/support/preURL.js +++ b/lib/support/preURL.js @@ -3,7 +3,7 @@ const log = require('intel').getLogger('browsertime'); const delay = ms => new Promise(res => setTimeout(res, ms)); -module.exports = async function(browser, options) { +module.exports = async function (browser, options) { log.info('Accessing preURL %s', options.preURL); await browser.loadAndWait(options.preURL); await delay(options.preURLDelay ? options.preURLDelay : 1500); diff --git a/lib/support/setResourceTimingBufferSize.js b/lib/support/setResourceTimingBufferSize.js index 1336f96ae1..5ecefeae92 100644 --- a/lib/support/setResourceTimingBufferSize.js +++ b/lib/support/setResourceTimingBufferSize.js @@ -1,6 +1,6 @@ 'use strict'; -module.exports = async function(startURL, driver, size) { +module.exports = async function (startURL, driver, size) { await driver.get(startURL); await driver.executeScript( `window.performance.setResourceTimingBufferSize(${size});` diff --git a/lib/support/statistics.js b/lib/support/statistics.js index 38d8363eed..57d40d6d9c 100644 --- a/lib/support/statistics.js +++ b/lib/support/statistics.js @@ -137,7 +137,7 @@ class Statistics { stats.stddev() / Math.sqrt(stats.length).toFixed(decimals) ) // "standard deviation of the mean" }; - percentiles.forEach(function(p) { + percentiles.forEach(function (p) { let name = percentileName(p); node[name] = parseFloat(stats.percentile(p).toFixed(decimals)); }); diff --git a/lib/support/stop.js b/lib/support/stop.js index ccce6ebdf0..cbf9bd0213 100644 --- a/lib/support/stop.js +++ b/lib/support/stop.js @@ -3,7 +3,7 @@ const execa = require('execa'); const log = require('intel').getLogger('browsertime'); -module.exports = async function(processName) { +module.exports = async function (processName) { const scriptArgs = ['-9', processName]; log.debug('Kill all processes ' + processName); diff --git a/lib/support/storageManager.js b/lib/support/storageManager.js index 62090bff79..690fc8d693 100644 --- a/lib/support/storageManager.js +++ b/lib/support/storageManager.js @@ -17,9 +17,7 @@ const unlink = promisify(fs.unlink); const mkdir = promisify(fs.mkdir); const defaultDir = 'browsertime-results'; -let timestamp = dayjs() - .format() - .replace(/:/g, ''); +let timestamp = dayjs().format().replace(/:/g, ''); function pathNameFromUrl(url) { const parsedUrl = urlParser.parse(url), @@ -29,10 +27,7 @@ function pathNameFromUrl(url) { if (!isEmpty(parsedUrl.search)) { const md5 = crypto.createHash('md5'), - hash = md5 - .update(parsedUrl.search) - .digest('hex') - .substring(0, 8); + hash = md5.update(parsedUrl.search).digest('hex').substring(0, 8); pathSegments.push('query-' + hash); } @@ -115,18 +110,18 @@ class StorageManager { } async gzip(inputFile, outputFile, removeInput) { - const promise = new Promise(function(resolve, reject) { + const promise = new Promise(function (resolve, reject) { const gzip = zlib.createGzip(); const input = fs.createReadStream(inputFile); const out = fs.createWriteStream(outputFile); - out.on('finish', function() { + out.on('finish', function () { if (removeInput) { unlink(inputFile).then(() => resolve()); } else { resolve(); } }); - out.on('error', function(e) { + out.on('error', function (e) { log.error('Could not gzip %s to %s', inputFile, outputFile, e); reject(); }); diff --git a/lib/video/postprocessing/finetune/addTextToVideo.js b/lib/video/postprocessing/finetune/addTextToVideo.js index 60f78f4625..6544fad3d2 100644 --- a/lib/video/postprocessing/finetune/addTextToVideo.js +++ b/lib/video/postprocessing/finetune/addTextToVideo.js @@ -15,7 +15,7 @@ function isSmallish(options) { ); } -module.exports = async function( +module.exports = async function ( inputFile, outputFile, videoMetrics, diff --git a/lib/video/postprocessing/finetune/convertFps.js b/lib/video/postprocessing/finetune/convertFps.js index e1c7f59e64..51657cf32a 100644 --- a/lib/video/postprocessing/finetune/convertFps.js +++ b/lib/video/postprocessing/finetune/convertFps.js @@ -3,7 +3,7 @@ const execa = require('execa'); const log = require('intel').getLogger('browsertime.video'); -module.exports = async function(src, dest, framerate) { +module.exports = async function (src, dest, framerate) { const scriptArgs = ['-nostdin', '-i', src, '-r', framerate, dest]; log.info('Converting video to %s fps', framerate); return execa('ffmpeg', scriptArgs); diff --git a/lib/video/postprocessing/finetune/getFont.js b/lib/video/postprocessing/finetune/getFont.js index ff022a688c..56be8a3c22 100644 --- a/lib/video/postprocessing/finetune/getFont.js +++ b/lib/video/postprocessing/finetune/getFont.js @@ -1,7 +1,7 @@ 'use strict'; const fs = require('fs'); -module.exports = function(options) { +module.exports = function (options) { // If the font is not part of the params and we're on macOS // we check that SFNSMono.ttf is available if (!options.videoParams.fontPath && process.platform === 'darwin') { diff --git a/lib/video/postprocessing/finetune/getTimingMetrics.js b/lib/video/postprocessing/finetune/getTimingMetrics.js index 9b5163cd5a..4e2fd23122 100644 --- a/lib/video/postprocessing/finetune/getTimingMetrics.js +++ b/lib/video/postprocessing/finetune/getTimingMetrics.js @@ -26,11 +26,12 @@ function get(metric, metricName, pos, options) { } // H-h/8 - return `drawtext=${fontFile}enable='between(t,${Number(metric) / - 1000},30)':x=(w-tw)/2: y=H-${pos}-h/${x}:fontcolor=white:fontsize=h/${fontSize}:box=1:boxcolor=0x000000AA:boxborderw=2:text='${metricName} ${metric}'`; + return `drawtext=${fontFile}enable='between(t,${ + Number(metric) / 1000 + },30)':x=(w-tw)/2: y=H-${pos}-h/${x}:fontcolor=white:fontsize=h/${fontSize}:box=1:boxcolor=0x000000AA:boxborderw=2:text='${metricName} ${metric}'`; } -module.exports = function(videoMetrics, timingMetrics, options) { +module.exports = function (videoMetrics, timingMetrics, options) { let text = ''; const vm = videoMetrics.visualMetrics; const startPosition = 'h/10'; @@ -59,7 +60,7 @@ module.exports = function(videoMetrics, timingMetrics, options) { }); } - metricsAndValues.sort(function(a, b) { + metricsAndValues.sort(function (a, b) { return b.value - a.value; }); diff --git a/lib/video/postprocessing/finetune/index.js b/lib/video/postprocessing/finetune/index.js index 1db98aeb43..5318e05e35 100644 --- a/lib/video/postprocessing/finetune/index.js +++ b/lib/video/postprocessing/finetune/index.js @@ -12,7 +12,7 @@ const rename = promisify(fs.rename); const unlink = promisify(fs.unlink); const defaults = require('../../defaults'); -module.exports = async function( +module.exports = async function ( videoDir, videoPath, index, diff --git a/lib/video/postprocessing/finetune/removeOrange.js b/lib/video/postprocessing/finetune/removeOrange.js index 8a03051430..db0f0c32b8 100644 --- a/lib/video/postprocessing/finetune/removeOrange.js +++ b/lib/video/postprocessing/finetune/removeOrange.js @@ -3,7 +3,7 @@ const execa = require('execa'); const log = require('intel').getLogger('browsertime.video'); -module.exports = async function( +module.exports = async function ( inputFile, outputFile, newStart, diff --git a/lib/video/postprocessing/visualmetrics/extraMetrics.js b/lib/video/postprocessing/visualmetrics/extraMetrics.js index f33a5f9ade..ec7290d55c 100644 --- a/lib/video/postprocessing/visualmetrics/extraMetrics.js +++ b/lib/video/postprocessing/visualmetrics/extraMetrics.js @@ -1,6 +1,6 @@ 'use strict'; -module.exports = function(metrics) { +module.exports = function (metrics) { const videoMetrics = {}; if (!metrics.VisualReadiness) { metrics.VisualReadiness = diff --git a/lib/video/postprocessing/visualmetrics/getVideoMetrics.js b/lib/video/postprocessing/visualmetrics/getVideoMetrics.js index 6e2cb0be68..cb12fd078c 100644 --- a/lib/video/postprocessing/visualmetrics/getVideoMetrics.js +++ b/lib/video/postprocessing/visualmetrics/getVideoMetrics.js @@ -5,7 +5,7 @@ const path = require('path'); const visualMetrics = require('./visualMetrics'); const extraMetrics = require('./extraMetrics'); -module.exports = async function( +module.exports = async function ( videoDir, filmstripDir, videoPath, diff --git a/lib/video/screenRecording/desktop/ffmpegRecorder.js b/lib/video/screenRecording/desktop/ffmpegRecorder.js index 2f8bceff99..7e52203713 100644 --- a/lib/video/screenRecording/desktop/ffmpegRecorder.js +++ b/lib/video/screenRecording/desktop/ffmpegRecorder.js @@ -38,9 +38,9 @@ async function buildX11FfmpegArgs({ '-r', 30, '-filter:v', - `crop=${widthAndHeight[0] * devicePixelRatio}:${widthAndHeight[1] * - devicePixelRatio}:${offset.x * devicePixelRatio}:${offset.y * - devicePixelRatio}`, + `crop=${widthAndHeight[0] * devicePixelRatio}:${ + widthAndHeight[1] * devicePixelRatio + }:${offset.x * devicePixelRatio}:${offset.y * devicePixelRatio}`, '-codec:v', 'libx264rgb', '-threads', diff --git a/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js b/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js index edc861fa7b..14d5586557 100644 --- a/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js +++ b/lib/video/screenRecording/desktop/osx/getSPDisplaysDataType.js @@ -2,7 +2,7 @@ const execa = require('execa'); -module.exports = async function() { +module.exports = async function () { const output = await execa.command('system_profiler SPDisplaysDataType', { shell: true }); diff --git a/lib/video/screenRecording/desktop/osx/getScreen.js b/lib/video/screenRecording/desktop/osx/getScreen.js index 347426d732..97fb31244e 100644 --- a/lib/video/screenRecording/desktop/osx/getScreen.js +++ b/lib/video/screenRecording/desktop/osx/getScreen.js @@ -3,7 +3,7 @@ const execa = require('execa'); const log = require('intel').getLogger('browsertime.video'); -module.exports = async function() { +module.exports = async function () { const scriptArgs = [ '-hide_banner', '-f', diff --git a/lib/video/screenRecording/firefox/firefoxWindowRecorder.js b/lib/video/screenRecording/firefox/firefoxWindowRecorder.js index 451bb5913b..20bfce3d22 100644 --- a/lib/video/screenRecording/firefox/firefoxWindowRecorder.js +++ b/lib/video/screenRecording/firefox/firefoxWindowRecorder.js @@ -81,7 +81,7 @@ function writeFrameDurationsToFile(directoryName, imageFiles) { const stream = fs.createWriteStream( path.join(directoryName, 'durations.txt') ); - stream.once('open', function() { + stream.once('open', function () { stream.write( "file '" + path.join(directoryName, imageFiles[0].filename) + "'\n" ); @@ -120,7 +120,7 @@ async function generateVideo(destination, recordingDirectoryName) { imageFiles.push({ filename: newFilename, offset: offset }); }); - imageFiles.sort(function(a, b) { + imageFiles.sort(function (a, b) { if (a.filename < b.filename) return -1; if (a.filename > b.filename) return 1; return 0; diff --git a/lib/video/screenRecording/setOrangeBackground.js b/lib/video/screenRecording/setOrangeBackground.js index c552db3d66..fa97b88562 100644 --- a/lib/video/screenRecording/setOrangeBackground.js +++ b/lib/video/screenRecording/setOrangeBackground.js @@ -2,7 +2,7 @@ const log = require('intel').getLogger('browsertime.video'); const { until, By } = require('selenium-webdriver'); -module.exports = async function(driver, options) { +module.exports = async function (driver, options) { log.debug('Add orange color'); // We tried other ways for Android (access an orange page) // That works fine ... but break scripts diff --git a/package-lock.json b/package-lock.json index b11442f528..23fdd4804d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,22 +5,28 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.4" } }, + "@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true + }, "@babel/highlight": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.3.tgz", - "integrity": "sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", "dev": true, "requires": { + "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", - "esutils": "^2.0.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -120,6 +126,68 @@ "async": "~0.2.9" } }, + "@eslint/eslintrc": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + } + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "@jimp/bmp": { "version": "0.16.1", "resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.16.1.tgz", @@ -547,21 +615,21 @@ "integrity": "sha512-mikldZQitV94akrc4sCcSjtJfsTKt4p+e/s0AGscVA6XArQ9kFclP+ZiYUMnq987rc6QlYxXv/EivqlfSLxpKA==" }, "acorn": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.1.tgz", - "integrity": "sha512-add7dgA5ppRPxCFJoAGfMDi7PIBXq1RtGo7BhbLaxwrXPOmw8gq48Y9ozT01hUKy9byMjlR20EJhu5zlkErEkg==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "dev": true }, "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, "ajv": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", - "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -576,12 +644,6 @@ "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", "dev": true }, - "ansi-escapes": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", - "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", - "dev": true - }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -614,9 +676,9 @@ "dev": true }, "astral-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, "async": { @@ -736,12 +798,6 @@ "supports-color": "^2.0.0" } }, - "chardet": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", - "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", - "dev": true - }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", @@ -795,21 +851,6 @@ } } }, - "cli-cursor": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", - "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", - "dev": true, - "requires": { - "restore-cursor": "^2.0.0" - } - }, - "cli-width": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", - "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", - "dev": true - }, "cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -930,9 +971,9 @@ } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, "define-properties": { @@ -979,6 +1020,23 @@ "once": "^1.4.0" } }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + }, + "dependencies": { + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + } + } + }, "es-abstract": { "version": "1.17.4", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz", @@ -1020,220 +1078,205 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.2.2.tgz", - "integrity": "sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw==", + "version": "7.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz", + "integrity": "sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==", "dev": true, "requires": { - "@babel/code-frame": "^7.0.0", + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.5", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^1.4.2", - "eslint-visitor-keys": "^1.1.0", - "espree": "^6.1.1", - "esquery": "^1.0.1", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", "esutils": "^2.0.2", - "file-entry-cache": "^5.0.1", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", - "globals": "^11.7.0", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.4.1", "is-glob": "^4.0.0", "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.14", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "optionator": "^0.8.2", + "optionator": "^0.9.1", "progress": "^2.0.0", - "regexpp": "^2.0.1", - "semver": "^6.1.2", - "strip-ansi": "^5.2.0", - "strip-json-comments": "^3.0.1", - "table": "^5.2.3", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" } }, "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { - "ms": "^2.1.1" + "ms": "2.1.2" } }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true - }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" } }, "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "has-flag": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" + "has-flag": "^4.0.0" } } } }, "eslint-config-prettier": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.1.0.tgz", - "integrity": "sha512-k9fny9sPjIBQ2ftFTesJV21Rg4R/7a7t7LCtZVrYQiHEp8Nnuk3EGaDmsKSAnsPj0BYcgB2zxzHa2NTkIxcOLg==", - "dev": true, - "requires": { - "get-stdin": "^6.0.0" - } + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.3.0.tgz", + "integrity": "sha512-BgZuLUSeKzvlL/VUjx/Yb787VQ26RU3gGjA3iiFvdsp/2bMfVIWUVP7tjxtjS0e+HP409cPlPvNkQloz8C91ew==", + "dev": true }, "eslint-plugin-prettier": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz", - "integrity": "sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", + "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", "dev": true, "requires": { - "esrecurse": "^4.1.0", + "esrecurse": "^4.3.0", "estraverse": "^4.1.1" } }, "eslint-utils": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", - "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.0.tgz", - "integrity": "sha512-Xs8airJ7RQolnDIbLtRutmfvSsAe0xqMMAantCN/GMoqf81TFbeI1T7Jpd56qYu1uuh32dOG5W/X9uO+ghPXzA==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", "dev": true, "requires": { - "acorn": "^7.1.0", - "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } } }, "esprima": { @@ -1243,21 +1286,37 @@ "dev": true }, "esquery": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.1.0.tgz", - "integrity": "sha512-MxYW9xKmROWF672KqjO75sszsA8Mxhw06YFeS5VHlB98KDHbOSurm3ArsjO60Eaf3QmGMCP1yn+0JQkNLo/97Q==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", "dev": true, "requires": { - "estraverse": "^4.0.0" + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "estraverse": { @@ -1301,32 +1360,10 @@ "integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=", "optional": true }, - "external-editor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", - "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", - "dev": true, - "requires": { - "chardet": "^0.7.0", - "iconv-lite": "^0.4.24", - "tmp": "^0.0.33" - }, - "dependencies": { - "tmp": { - "version": "0.0.33", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", - "dev": true, - "requires": { - "os-tmpdir": "~1.0.2" - } - } - } - }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-diff": { @@ -1352,22 +1389,13 @@ "resolved": "https://registry.npmjs.org/fast-stats/-/fast-stats-0.0.6.tgz", "integrity": "sha512-m0zkwa7Z07Wc4xm1YtcrCHmhzNxiYRrrfUyhkdhSZPzaAH/Ewbocdaq7EPVBFz19GWfIyyPcLfRHjHJYe83jlg==" }, - "figures": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", - "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, "file-entry-cache": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "requires": { - "flat-cache": "^2.0.1" + "flat-cache": "^3.0.4" } }, "file-type": { @@ -1395,31 +1423,19 @@ } }, "flat-cache": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "requires": { - "flatted": "^2.0.0", - "rimraf": "2.6.3", - "write": "1.0.3" - }, - "dependencies": { - "rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } + "flatted": "^3.1.0", + "rimraf": "^3.0.2" } }, "flatted": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==", "dev": true }, "fs-minipass": { @@ -1463,12 +1479,6 @@ "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz", "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==" }, - "get-stdin": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", - "dev": true - }, "get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -1498,9 +1508,9 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -1517,10 +1527,13 @@ } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz", + "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } }, "growl": { "version": "1.10.5", @@ -1583,15 +1596,6 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -1621,9 +1625,9 @@ "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=" }, "import-fresh": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -1650,108 +1654,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "inquirer": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", - "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.2.0", - "chalk": "^2.4.2", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^3.0.3", - "figures": "^2.0.0", - "lodash": "^4.17.12", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rxjs": "^6.4.0", - "string-width": "^2.1.0", - "strip-ansi": "^5.1.0", - "through": "^2.3.6" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", - "dev": true, - "requires": { - "ansi-regex": "^4.1.0" - }, - "dependencies": { - "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", - "dev": true - } - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "intel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/intel/-/intel-1.2.0.tgz", @@ -1811,20 +1713,14 @@ "optional": true }, "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "requires": { "is-extglob": "^2.1.1" } }, - "is-promise": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", - "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", - "dev": true - }, "is-regex": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", @@ -1925,13 +1821,13 @@ } }, "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" } }, "lie": { @@ -1972,6 +1868,12 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -2007,6 +1909,12 @@ "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -2056,6 +1964,15 @@ "source-map-support": "0.3.2 - 1.0.0" } }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, "map-age-cleaner": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", @@ -2135,6 +2052,7 @@ "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "optional": true, "requires": { "minimist": "^1.2.5" } @@ -2418,12 +2336,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, - "mute-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", - "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", - "dev": true - }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -2540,17 +2452,17 @@ } }, "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" } }, "os-locale": { @@ -2654,12 +2566,6 @@ } } }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", @@ -2796,15 +2702,15 @@ "optional": true }, "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { - "version": "1.18.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.18.2.tgz", - "integrity": "sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", + "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", "dev": true }, "prettier-linter-helpers": { @@ -2874,9 +2780,9 @@ "optional": true }, "regexpp": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", - "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "require-directory": { @@ -2884,6 +2790,12 @@ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -2896,33 +2808,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "restore-cursor": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", - "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", - "dev": true, - "requires": { - "onetime": "^2.0.0", - "signal-exit": "^3.0.2" - }, - "dependencies": { - "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "^1.0.0" - } - } - } - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -2931,35 +2816,11 @@ "glob": "^7.1.3" } }, - "run-async": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.0.tgz", - "integrity": "sha512-xJTbh/d7Lm7SBhc1tNvTpeCHaEzoyxPrqNlvSdMfBTYwaY++UJFyXUOxAtsRUXjlqOfj8luNaR9vjCh4KeV+pg==", - "dev": true, - "requires": { - "is-promise": "^2.1.0" - } - }, - "rxjs": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.4.tgz", - "integrity": "sha512-naMQXcgEo3csAEGvw/NydRA0fuS2nDZJiw1YUWFKU7aPPAPGZEsD4Iimit96qwCieH6y614MCLYwdkrWx7z/7Q==", - "dev": true, - "requires": { - "tslib": "^1.9.0" - } - }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -2977,6 +2838,15 @@ "ws": ">=7.4.6" } }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -3008,29 +2878,44 @@ "dev": true }, "slice-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "astral-regex": "^1.0.0", - "is-fullwidth-code-point": "^2.0.0" + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" }, "dependencies": { "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true } } @@ -3160,53 +3045,67 @@ "integrity": "sha1-tvmpANSWpX8CQI8iGYwQndoGMEE=" }, "table": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.2.tgz", + "integrity": "sha512-UFZK67uvyNivLeQbVtkiUs8Uuuxv24aSL4/Vil2PJVtMgU8Lx0CYkP12uCGa3kjyQzOSgV1+z9Wkb82fCGsO0g==", "dev": true, "requires": { - "ajv": "^6.10.2", - "lodash": "^4.17.14", - "slice-ansi": "^2.1.0", - "string-width": "^3.0.0" + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" }, "dependencies": { + "ajv": { + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^4.1.0" + "ansi-regex": "^5.0.1" } } } @@ -3272,19 +3171,13 @@ "universalify": "^0.1.2" } }, - "tslib": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.1.tgz", - "integrity": "sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==", - "dev": true - }, "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { - "prelude-ls": "~1.1.2" + "prelude-ls": "^1.2.1" } }, "type-detect": { @@ -3293,26 +3186,24 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, "utcstring": { @@ -3340,9 +3231,9 @@ "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==" }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, "which": { @@ -3440,15 +3331,6 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, - "write": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", - "dev": true, - "requires": { - "mkdirp": "^0.5.1" - } - }, "ws": { "version": "7.5.3", "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.3.tgz", diff --git a/package.json b/package.json index b73cb99acb..ce2b2fb56a 100644 --- a/package.json +++ b/package.json @@ -37,12 +37,12 @@ "bluebird": "3.5.5", "chai": "4.2.0", "chai-as-promised": "7.1.1", - "eslint": "6.2.2", - "eslint-config-prettier": "6.1.0", - "eslint-plugin-prettier": "3.1.0", + "eslint": "7.32.0", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-prettier": "4.0.0", "longjohn": "0.2.12", "mocha": "6.2.0", - "prettier": "1.18.2" + "prettier": "2.4.1" }, "engines": { "node": ">=10.13.0" diff --git a/test/browserTests/engineTests.js b/test/browserTests/engineTests.js index 25a1ecbe49..2380400dd0 100644 --- a/test/browserTests/engineTests.js +++ b/test/browserTests/engineTests.js @@ -12,18 +12,18 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { BROWSERS.push('chrome', 'firefox'); } -describe('Engine', function() { +describe('Engine', function () { let engine; - BROWSERS.forEach(function(browser) { - describe('#run - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('#run - ' + browser, function () { const scripts = { foo: '(function () {return "fff";})()', uri: 'document.documentURI', fourtytwo: '(function () {return 42;})()' }; - beforeEach(function() { + beforeEach(function () { engine = new Engine({ browser: browser, iterations: 2, @@ -34,13 +34,13 @@ describe('Engine', function() { return engine.start(); }); - it('should be able to load a url', function() { + it('should be able to load a url', function () { // somewhat clunky way to ignore generated har data in test. let browserScripts = engine .run('https://www.sitespeed.io/testcases/info/domElements.html', { scripts }) - .then(function(r) { + .then(function (r) { return r[0].browserScripts; }); return browserScripts.should.become([ @@ -61,25 +61,25 @@ describe('Engine', function() { ]); }); - it('should be able to load multiple urls', function() { + it('should be able to load multiple urls', function () { return engine .run('https://www.sitespeed.io/testcases/info/domElements.html', { scripts }) - .then(function() { + .then(function () { return engine.run( 'https://www.sitespeed.io/testcases/info/responsive.html', { scripts } ); }).should.be.fulfilled; }); - it('should be able to generate a har', function() { + it('should be able to generate a har', function () { // somewhat clunky way to ignore generated har data in test. return engine .run('https://www.sitespeed.io/testcases/info/domElements.html', { scripts }) - .then(function(r) { + .then(function (r) { return r.har.should.have.nested.property( 'log.entries[0].request.url' ); @@ -94,7 +94,7 @@ describe('Engine', function() { ); }); - describe('#run async - ' + browser, function() { + describe('#run async - ' + browser, function () { const syncScripts = { foo: '(function () {return "fff";})()', uri: 'document.documentURI', @@ -104,7 +104,7 @@ describe('Engine', function() { promiseFourtyThree: 'Promise.resolve(43)' }; - beforeEach(function() { + beforeEach(function () { engine = new Engine({ browser: browser, iterations: 1, @@ -113,14 +113,14 @@ describe('Engine', function() { return engine.start(); }); - it('should be able to run async script', function() { + it('should be able to run async script', function () { let browserScripts = engine .run( 'https://www.sitespeed.io/testcases/info/domElements.html', { scripts: syncScripts }, { scripts: asyncScripts } ) - .then(function(r) { + .then(function (r) { return r[0].browserScripts; }); return browserScripts.should.become([ @@ -135,7 +135,7 @@ describe('Engine', function() { ]); }); - it('should be able to run async fetch script', function() { + it('should be able to run async fetch script', function () { let browserScripts = engine .run( 'https://www.sitespeed.io/testcases/info/domElements.html', @@ -153,7 +153,7 @@ describe('Engine', function() { } } ) - .then(function(r) { + .then(function (r) { return r[0].browserScripts; }); return browserScripts.should.become([ @@ -173,7 +173,7 @@ describe('Engine', function() { ); }); - describe('#pre/post scripts - ' + browser, function() { + describe('#pre/post scripts - ' + browser, function () { function loadTaskFile(file) { return require(path.resolve(__dirname, '..', 'prepostscripts', file)); } @@ -184,7 +184,7 @@ describe('Engine', function() { fourtytwo: '(function () {return 42;})()' }; - beforeEach(function() { + beforeEach(function () { engine = new Engine({ browser: browser, iterations: 1, @@ -195,7 +195,7 @@ describe('Engine', function() { return engine.start(); }); - it('should run pre and post tasks', function() { + it('should run pre and post tasks', function () { return engine.run('data:text/html;charset=utf-8,', { scripts }); }); @@ -207,14 +207,14 @@ describe('Engine', function() { ); }); - describe('#pageCompleteCheck inline - ' + browser, function() { + describe('#pageCompleteCheck inline - ' + browser, function () { const scripts = { foo: '(function () {return "fff";})()', uri: 'document.documentURI', fourtytwo: '(function () {return 42;})()' }; - beforeEach(function() { + beforeEach(function () { engine = new Engine({ browser: browser, iterations: 1, @@ -225,7 +225,7 @@ describe('Engine', function() { return engine.start(); }); - it('should run 5-second pageCompleteCheck from inline javascript', function() { + it('should run 5-second pageCompleteCheck from inline javascript', function () { return engine.run('data:text/html;charset=utf-8,', { scripts }); }); @@ -237,14 +237,14 @@ describe('Engine', function() { ); }); - describe('#pageCompleteScript from file - ' + browser, function() { + describe('#pageCompleteScript from file - ' + browser, function () { const scripts = { foo: '(function () {return "fff";})()', uri: 'document.documentURI', fourtytwo: '(function () {return 42;})()' }; - beforeEach(function() { + beforeEach(function () { engine = new Engine({ browser: browser, iterations: 1, @@ -254,7 +254,7 @@ describe('Engine', function() { return engine.start(); }); - it('should run 10-second pageCompleteScript from script file', function() { + it('should run 10-second pageCompleteScript from script file', function () { return engine.run('data:text/html;charset=utf-8,', { scripts }); }); diff --git a/test/browserTests/seleniumRunnerTests.js b/test/browserTests/seleniumRunnerTests.js index a5770a35d6..8f70bf2a43 100644 --- a/test/browserTests/seleniumRunnerTests.js +++ b/test/browserTests/seleniumRunnerTests.js @@ -28,11 +28,11 @@ function timeout(promise, ms, errorMessage) { ]); } -describe('SeleniumRunner', function() { +describe('SeleniumRunner', function () { let runner; - describe('#start', function() { - it('should reject when passed incorrect configuration', function() { + describe('#start', function () { + it('should reject when passed incorrect configuration', function () { runner = new SeleniumRunner(BASE_PATH, { browser: 'invalid' }); @@ -40,7 +40,7 @@ describe('SeleniumRunner', function() { }); if (BROWSERS.includes('chrome')) { - it.skip('should handle if Chrome crashes', function() { + it.skip('should handle if Chrome crashes', function () { runner = new SeleniumRunner(BASE_PATH, { browser: 'chrome', chrome: { @@ -51,16 +51,16 @@ describe('SeleniumRunner', function() { }); // Wait for session to actually have Chrome start up. - return runner.start().catch(function(e) { + return runner.start().catch(function (e) { throw e; }).should.be.rejected; }); } }); - BROWSERS.forEach(function(browser) { - describe('#loadAndWait - ' + browser, function() { - beforeEach(function() { + BROWSERS.forEach(function (browser) { + describe('#loadAndWait - ' + browser, function () { + beforeEach(function () { runner = new SeleniumRunner(BASE_PATH, { browser: browser, timeouts: { @@ -77,40 +77,40 @@ describe('SeleniumRunner', function() { return runner.start(); }); - it('should be able to load a url', function() { + it('should be able to load a url', function () { return runner.loadAndWait( 'https://www.sitespeed.io/testcases/info/domElements.html' ).should.be.fulfilled; }); - it.skip('should fail if url takes too long to load, enable this when httpbin works again', function() { + it.skip('should fail if url takes too long to load, enable this when httpbin works again', function () { return runner.loadAndWait( 'https://httpbin.org/delay/20', 'return true' ).should.be.rejected; }); - it('should fail if wait script never returns true', function() { + it('should fail if wait script never returns true', function () { return runner.loadAndWait( 'https://www.sitespeed.io/testcases/info/domElements.html', 'return false' ).should.be.rejected; }); - it('should fail if wait script throws an exception', function() { + it('should fail if wait script throws an exception', function () { return runner.loadAndWait( 'https://www.sitespeed.io/testcases/info/domElements.html', 'throw new Error("foo");' ).should.be.rejected; }); - it.skip('should fail if wait script hangs', function() { + it.skip('should fail if wait script hangs', function () { return runner.loadAndWait( 'https://www.sitespeed.io/testcases/info/domElements.html', 'while (true) {}; return true;' ).should.be.rejected; }); - afterEach(function() { + afterEach(function () { return timeout( runner.stop(), 10000, @@ -119,43 +119,46 @@ describe('SeleniumRunner', function() { }); }); - PAGE_LOAD_STRATEGIES.forEach(function(strategy) { - describe('#pageLoadStrategy - ' + browser + ' - ' + strategy, function() { - beforeEach(function() { - runner = new SeleniumRunner({ - browser: browser, - timeouts: { - browserStart: 60000, - scripts: 5000, - pageLoad: 10000, - pageCompleteCheck: 10000 - }, - pageLoadStrategy: strategy, - headless: true + PAGE_LOAD_STRATEGIES.forEach(function (strategy) { + describe( + '#pageLoadStrategy - ' + browser + ' - ' + strategy, + function () { + beforeEach(function () { + runner = new SeleniumRunner({ + browser: browser, + timeouts: { + browserStart: 60000, + scripts: 5000, + pageLoad: 10000, + pageCompleteCheck: 10000 + }, + pageLoadStrategy: strategy, + headless: true + }); + return runner.start().then(function () { + return runner.loadAndWait('data:text/html;charset=utf-8,'); + }); }); - return runner.start().then(function() { - return runner.loadAndWait('data:text/html;charset=utf-8,'); - }); - }); - it('should be able to load a url', function() { - return runner.loadAndWait( - 'https://www.sitespeed.io/testcases/info/domElements.html' - ).should.be.fulfilled; - }); + it('should be able to load a url', function () { + return runner.loadAndWait( + 'https://www.sitespeed.io/testcases/info/domElements.html' + ).should.be.fulfilled; + }); - afterEach(function() { - return timeout( - runner.stop(), - 10000, - 'Waited for ' + browser + ' to quit for too long' - ); - }); - }); + afterEach(function () { + return timeout( + runner.stop(), + 10000, + 'Waited for ' + browser + ' to quit for too long' + ); + }); + } + ); }); - describe('#runScript - ' + browser, function() { - beforeEach(function() { + describe('#runScript - ' + browser, function () { + beforeEach(function () { runner = new SeleniumRunner({ browser: browser, timeouts: { @@ -167,32 +170,32 @@ describe('SeleniumRunner', function() { pageLoadStrategy: 'normal', headless: true }); - return runner.start().then(function() { + return runner.start().then(function () { return runner.loadAndWait('data:text/html;charset=utf-8,'); }); }); - it('should handle a boolean return', function() { + it('should handle a boolean return', function () { return runner.runScript('return true;').should.become(true); }); - it('should handle a number return', function() { + it('should handle a number return', function () { return runner.runScript('return 42;').should.become(42); }); - it('should handle an object return', function() { + it('should handle an object return', function () { return runner .runScript('return window.performance.timing;') .should.eventually.contain.all.keys('fetchStart', 'domInteractive'); }); - it('should handle an array return', function() { + it('should handle an array return', function () { return runner .runScript('return window.performance.getEntriesByType("resource");') .should.eventually.be.an('array'); }); - it('should fail if script throws an exception', function() { + it('should fail if script throws an exception', function () { return runner.runScript('throw new Error("foo");').should.be.rejected; }); @@ -206,13 +209,13 @@ describe('SeleniumRunner', function() { at Context. (/Users/tobli/Development/btnext/test/seleniumRunnerTests.js:93:75) */ - it.skip('should fail if script hangs', function() { + it.skip('should fail if script hangs', function () { return runner.runScript( 'while (true) {}; return true;' ).should.be.rejected; }); - afterEach(function() { + afterEach(function () { return timeout( runner.stop(), 10000, @@ -221,8 +224,8 @@ describe('SeleniumRunner', function() { }); }); - describe('#takeScreenshot - ' + browser, function() { - beforeEach(function() { + describe('#takeScreenshot - ' + browser, function () { + beforeEach(function () { runner = new SeleniumRunner(BASE_PATH, { browser: browser, timeouts: { @@ -233,12 +236,12 @@ describe('SeleniumRunner', function() { }, headless: true }); - return runner.start().then(function() { + return runner.start().then(function () { return runner.loadAndWait('data:text/html;charset=utf-8,'); }); }); - it('should take a screen shot', function() { + it('should take a screen shot', function () { return runner .takeScreenshot() .should.eventually.be.an.instanceof(Buffer); diff --git a/test/commandTests/chromeTests.js b/test/commandTests/chromeTests.js index cce7a15dab..af36136c22 100644 --- a/test/commandTests/chromeTests.js +++ b/test/commandTests/chromeTests.js @@ -10,20 +10,20 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { } else { BROWSERS.push('chrome'); } -describe('command', function() { +describe('command', function () { let engine; function getPath(file) { return path.resolve(__dirname, '..', 'commandscripts', file); } - BROWSERS.forEach(function(browser) { - describe('misc - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('misc - ' + browser, function () { const scripts = { uri: 'document.documentURI' }; - beforeEach(async function() { + beforeEach(async function () { engine = new Engine({ browser: browser, iterations: 1, @@ -35,7 +35,7 @@ describe('command', function() { afterEach(() => engine.stop()); - it('should be able to to run Chrome specific commands', async function() { + it('should be able to to run Chrome specific commands', async function () { const result = await engine.runMultiple([getPath('chrome.js')], { scripts }); diff --git a/test/commandTests/clickTests.js b/test/commandTests/clickTests.js index 40b0cfa3fb..f762631d88 100644 --- a/test/commandTests/clickTests.js +++ b/test/commandTests/clickTests.js @@ -10,20 +10,20 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { } else { BROWSERS.push('chrome', 'firefox'); } -describe('command', function() { +describe('command', function () { let engine; function getPath(file) { return path.resolve(__dirname, '..', 'commandscripts', file); } - BROWSERS.forEach(function(browser) { - describe('click and measure - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('click and measure - ' + browser, function () { const scripts = { uri: 'document.documentURI' }; - beforeEach(async function() { + beforeEach(async function () { engine = new Engine({ browser: browser, iterations: 1, @@ -35,7 +35,7 @@ describe('command', function() { afterEach(() => engine.stop()); - it('should be able to measure the urls after a click', async function() { + it('should be able to measure the urls after a click', async function () { const result = await engine.runMultiple( [getPath('clickAndMeasure.js')], { @@ -47,7 +47,7 @@ describe('command', function() { ); }); - it('should be able to give an URL after a click an alias', async function() { + it('should be able to give an URL after a click an alias', async function () { const result = await engine.runMultiple( [getPath('clickAndMeasure.js')], { @@ -57,7 +57,7 @@ describe('command', function() { result[0].info.alias.should.equal('documentation'); }); - it('should be able to measure the urls after multiple clicks', async function() { + it('should be able to measure the urls after multiple clicks', async function () { const result = await engine.runMultiple( [getPath('clickBackAndForth.js')], { diff --git a/test/commandTests/measureTests.js b/test/commandTests/measureTests.js index 723ec32009..50dec68612 100644 --- a/test/commandTests/measureTests.js +++ b/test/commandTests/measureTests.js @@ -10,20 +10,20 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { } else { BROWSERS.push('chrome', 'firefox'); } -describe('command', function() { +describe('command', function () { let engine; function getPath(file) { return path.resolve(__dirname, '..', 'commandscripts', file); } - BROWSERS.forEach(function(browser) { - describe('measure - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('measure - ' + browser, function () { const scripts = { uri: 'document.documentURI' }; - beforeEach(async function() { + beforeEach(async function () { engine = new Engine({ browser: browser, iterations: 1, @@ -35,7 +35,7 @@ describe('command', function() { afterEach(() => engine.stop()); - it('should be able to measure two urls after each other', async function() { + it('should be able to measure two urls after each other', async function () { const result = await engine.runMultiple([getPath('measure.js')], { scripts }); @@ -47,7 +47,7 @@ describe('command', function() { ); }); - it('should be able to give each URL an alias', async function() { + it('should be able to give each URL an alias', async function () { const result = await engine.runMultiple([getPath('measureAlias.js')], { scripts }); diff --git a/test/commandTests/miscTests.js b/test/commandTests/miscTests.js index 44912e3b71..fd6f3fb9ef 100644 --- a/test/commandTests/miscTests.js +++ b/test/commandTests/miscTests.js @@ -10,20 +10,20 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { } else { BROWSERS.push('chrome', 'firefox'); } -describe('command', function() { +describe('command', function () { let engine; function getPath(file) { return path.resolve(__dirname, '..', 'commandscripts', file); } - BROWSERS.forEach(function(browser) { - describe('misc - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('misc - ' + browser, function () { const scripts = { uri: 'document.documentURI' }; - beforeEach(async function() { + beforeEach(async function () { engine = new Engine({ browser: browser, iterations: 1, @@ -35,7 +35,7 @@ describe('command', function() { afterEach(() => engine.stop()); - it('should be able to to run misc commands', async function() { + it('should be able to to run misc commands', async function () { const result = await engine.runMultiple([getPath('misc.js')], { scripts }); diff --git a/test/commandTests/scrollTests.js b/test/commandTests/scrollTests.js index 0500e4ac00..20fd894266 100644 --- a/test/commandTests/scrollTests.js +++ b/test/commandTests/scrollTests.js @@ -10,20 +10,20 @@ if (process.env.BROWSERTIME_TEST_BROWSER) { } else { BROWSERS.push('chrome', 'firefox'); } -describe('command', function() { +describe('command', function () { let engine; function getPath(file) { return path.resolve(__dirname, '..', 'commandscripts', file); } - BROWSERS.forEach(function(browser) { - describe('misc - ' + browser, function() { + BROWSERS.forEach(function (browser) { + describe('misc - ' + browser, function () { const scripts = { uri: 'document.documentURI' }; - beforeEach(async function() { + beforeEach(async function () { engine = new Engine({ browser: browser, iterations: 1, @@ -35,13 +35,13 @@ describe('command', function() { afterEach(() => engine.stop()); - it('should be able to to run scroll by pixel command', async function() { + it('should be able to to run scroll by pixel command', async function () { await engine.runMultiple([getPath('scrollByPixel.js')], { scripts }); }); - it('should be able to to run scroll to bottom command', async function() { + it('should be able to to run scroll to bottom command', async function () { await engine.runMultiple([getPath('scrollToBottom.js')], { scripts }); diff --git a/test/commandscripts/chrome.js b/test/commandscripts/chrome.js index ecdd9eacc9..fcc94a7d86 100644 --- a/test/commandscripts/chrome.js +++ b/test/commandscripts/chrome.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { const responses = []; await commands.cdp.on('Network.responseReceived', params => { responses.push(params); diff --git a/test/commandscripts/clickAndMeasure.js b/test/commandscripts/clickAndMeasure.js index 3f3d469434..a53b74923b 100644 --- a/test/commandscripts/clickAndMeasure.js +++ b/test/commandscripts/clickAndMeasure.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.navigate('https://www.sitespeed.io/'); await commands.measure.start('documentation'); await commands.click.byLinkTextAndWait('Documentation'); diff --git a/test/commandscripts/clickBackAndForth.js b/test/commandscripts/clickBackAndForth.js index 3c03374952..6c55a85d33 100644 --- a/test/commandscripts/clickBackAndForth.js +++ b/test/commandscripts/clickBackAndForth.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.navigate('https://www.sitespeed.io/'); await commands.click.byPartialLinkTextAndWait('Blo'); await commands.click.bySelectorAndWait( diff --git a/test/commandscripts/measure.js b/test/commandscripts/measure.js index b2857585e1..e5a5d8449a 100644 --- a/test/commandscripts/measure.js +++ b/test/commandscripts/measure.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('https://www.sitespeed.io'); return commands.measure.start('https://www.sitespeed.io/documentation/'); }; diff --git a/test/commandscripts/measureAlias.js b/test/commandscripts/measureAlias.js index 2b6a35cbf3..83d93e3db4 100644 --- a/test/commandscripts/measureAlias.js +++ b/test/commandscripts/measureAlias.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('https://www.sitespeed.io', 'url1'); return commands.measure.start( 'https://www.sitespeed.io/documentation/', diff --git a/test/commandscripts/misc.js b/test/commandscripts/misc.js index 7e83eb08f0..df64727b28 100644 --- a/test/commandscripts/misc.js +++ b/test/commandscripts/misc.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.navigate('https://www.sitespeed.io/search/'); await commands.addText.byId('grafana', 'search-input'); await commands.set.innerTextById('grafana2', 'search-input'); diff --git a/test/commandscripts/mouse.js b/test/commandscripts/mouse.js index aee0ce3170..7ce6084a15 100644 --- a/test/commandscripts/mouse.js +++ b/test/commandscripts/mouse.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.navigate('https://www.sitespeed.io/documentation/'); await commands.wait.byTime(1000); await commands.mouse.contextClick.byXpath( diff --git a/test/commandscripts/scrollByPixel.js b/test/commandscripts/scrollByPixel.js index 590ba096c5..b26bfbf349 100644 --- a/test/commandscripts/scrollByPixel.js +++ b/test/commandscripts/scrollByPixel.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('scroll'); await commands.navigate( 'https://www.sitespeed.io/documentation/sitespeed.io/scripting/' diff --git a/test/commandscripts/scrollToBottom.js b/test/commandscripts/scrollToBottom.js index 0ad3f337af..103b0ae5a5 100644 --- a/test/commandscripts/scrollToBottom.js +++ b/test/commandscripts/scrollToBottom.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('scroll'); await commands.navigate('https://github.com/sitespeedio/browsertime'); await commands.wait.byTime(1000); diff --git a/test/commandscripts/stopWatch.js b/test/commandscripts/stopWatch.js index a0af453872..eaeaa5e75a 100644 --- a/test/commandscripts/stopWatch.js +++ b/test/commandscripts/stopWatch.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { const before = commands.stopWatch.get('Before_navigating_page'); await commands.navigate('https://www.sitespeed.io/search/'); before.stop(); diff --git a/test/navigationscript/measure.js b/test/navigationscript/measure.js index f50a6f9444..b2ab6050c4 100644 --- a/test/navigationscript/measure.js +++ b/test/navigationscript/measure.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { context.log.info('Running script navigation'); return commands.measure.start('https://www.sitespeed.io/'); }; diff --git a/test/navigationscript/multi.js b/test/navigationscript/multi.js index a2a17c0bc2..e413246d3d 100644 --- a/test/navigationscript/multi.js +++ b/test/navigationscript/multi.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('https://www.sitespeed.io'); await commands.measure.start('https://www.sitespeed.io/examples/'); return commands.measure.start('https://www.sitespeed.io/documentation/'); diff --git a/test/navigationscript/navigateAndStartInTwoSteps.js b/test/navigationscript/navigateAndStartInTwoSteps.js index 35b42260ec..e0d8300a35 100644 --- a/test/navigationscript/navigateAndStartInTwoSteps.js +++ b/test/navigationscript/navigateAndStartInTwoSteps.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.navigate('https://www.sitespeed.io'); // we fetch the selenium webdriver from context const webdriver = context.selenium.webdriver; diff --git a/test/navigationscript/sameURLTwice.js b/test/navigationscript/sameURLTwice.js index cff51f4f5f..cf43a55b43 100644 --- a/test/navigationscript/sameURLTwice.js +++ b/test/navigationscript/sameURLTwice.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('https://www.sitespeed.io'); await commands.navigate('about:blank'); return commands.measure.start('https://www.sitespeed.io'); diff --git a/test/navigationscript/sameURLTwiceWithClick.js b/test/navigationscript/sameURLTwiceWithClick.js index e2ec6a3f95..fddad99447 100644 --- a/test/navigationscript/sameURLTwiceWithClick.js +++ b/test/navigationscript/sameURLTwiceWithClick.js @@ -1,4 +1,4 @@ -module.exports = async function(context, commands) { +module.exports = async function (context, commands) { await commands.measure.start('https://www.sitespeed.io/documentation/'); await commands.measure.start('https://www.sitespeed.io'); // Hide everything diff --git a/test/unitTests/browserScriptTests.js b/test/unitTests/browserScriptTests.js index a53c3feccd..3de9e708f5 100644 --- a/test/unitTests/browserScriptTests.js +++ b/test/unitTests/browserScriptTests.js @@ -11,8 +11,8 @@ const TEST_SCRIPTS_FOLDER = path.resolve( 'testscripts' ); -describe('#parseBrowserScripts', function() { - it('should parse valid scripts', function() { +describe('#parseBrowserScripts', function () { + it('should parse valid scripts', function () { return parser .findAndParseScripts(TEST_SCRIPTS_FOLDER, 'custom') .then(scriptsByCategory => { @@ -29,7 +29,7 @@ describe('#parseBrowserScripts', function() { }); }); - it('should get scripts for all categories', function() { + it('should get scripts for all categories', function () { return parser.allScriptCategories .then(categories => parser.getScriptsForCategories(categories)) .then(scriptsByCategory => { diff --git a/test/unitTests/harBuilderTests.js b/test/unitTests/harBuilderTests.js index b0ee054eec..6a845e8127 100644 --- a/test/unitTests/harBuilderTests.js +++ b/test/unitTests/harBuilderTests.js @@ -3,10 +3,10 @@ let builder = require('../../lib/support/har/'), expect = require('chai').expect; -describe('har_builder', function() { +describe('har_builder', function () { let har; - beforeEach(function() { + beforeEach(function () { har = { log: { version: '1.2', @@ -29,22 +29,22 @@ describe('har_builder', function() { }; }); - describe('#addCreator', function() { - it('should add creator if missing', function() { + describe('#addCreator', function () { + it('should add creator if missing', function () { builder.addCreator(har, 'foo'); expect(har).to.have.nested.property('log.creator.name', 'Browsertime'); expect(har).to.have.nested.property('log.creator.comment', 'foo'); }); - it('should not add comment to creator unless specified', function() { + it('should not add comment to creator unless specified', function () { builder.addCreator(har); expect(har).to.have.nested.property('log.creator.name', 'Browsertime'); expect(har).to.not.have.nested.property('log.creator.comment'); }); - it('should not add empty comment to creator', function() { + it('should not add empty comment to creator', function () { builder.addCreator(har, ''); expect(har).to.have.nested.property('log.creator.name', 'Browsertime'); @@ -52,8 +52,8 @@ describe('har_builder', function() { }); }); - describe('#mergeHars', function() { - it('should merge two hars', function() { + describe('#mergeHars', function () { + it('should merge two hars', function () { builder.addCreator(har); let har2 = { @@ -115,11 +115,11 @@ describe('har_builder', function() { }); }); - describe('#addExtraFieldsToHar', function() { + describe('#addExtraFieldsToHar', function () { let options; let totalResults; - beforeEach(function() { + beforeEach(function () { options = { iterations: 1 }; @@ -163,11 +163,11 @@ describe('har_builder', function() { ]; }); - it('should gracefully handle missing data', function() { + it('should gracefully handle missing data', function () { builder.addExtraFieldsToHar(); }); - it('should add visual metrics if given', function() { + it('should add visual metrics if given', function () { har.log.pages[0].pageTimings = {}; builder.addExtraFieldsToHar(totalResults, har, options); @@ -181,9 +181,9 @@ describe('har_builder', function() { PerceptualSpeedIndex: 200, ContentfulSpeedIndex: 300, VisualProgress: { - '0': 0, - '10': 50, - '20': 100 + 0: 0, + 10: 50, + 20: 100 } }, pageTimings: { @@ -198,7 +198,7 @@ describe('har_builder', function() { }); }); - it('should gracefully handle missing cpu and visual metrics', function() { + it('should gracefully handle missing cpu and visual metrics', function () { har.log.pages[0].pageTimings = {}; totalResults[0].visualMetrics = []; totalResults[0].cpu = [{}]; diff --git a/test/unitTests/statisticsTests.js b/test/unitTests/statisticsTests.js index 5f0686d065..66522ff68a 100644 --- a/test/unitTests/statisticsTests.js +++ b/test/unitTests/statisticsTests.js @@ -3,15 +3,15 @@ let assert = require('assert'), Statistics = require('../../lib/support/statistics').Statistics; -describe('statistics', function() { +describe('statistics', function () { let stats; - beforeEach(function() { + beforeEach(function () { stats = new Statistics(); }); - describe('#add', function() { - it('should be possible to add multiple keys', function() { + describe('#add', function () { + it('should be possible to add multiple keys', function () { for (let i = 0; i < 11; i++) { stats.add('foo', i + 1); stats.add('bar', 11 - i); @@ -20,36 +20,36 @@ describe('statistics', function() { assert.deepEqual(result.foo, result.bar); }); - it('should handle keys with dots', function() { + it('should handle keys with dots', function () { stats.add('1.2.3', 42.0); let result = stats.summarize(); assert.deepEqual(result['1.2.3'].mean, 42.0); }); - it('should require string keys', function() { - assert.throws(function() { + it('should require string keys', function () { + assert.throws(function () { stats.add(3, 3); }, TypeError); }); - it('should require numeric values', function() { - assert.throws(function() { + it('should require numeric values', function () { + assert.throws(function () { stats.add('a', 'a'); }, TypeError); }); - it('should require finite values', function() { - assert.throws(function() { + it('should require finite values', function () { + assert.throws(function () { stats.add('a', NaN); }, RangeError); - assert.throws(function() { + assert.throws(function () { stats.add('a', Infinity); }, RangeError); }); }); - describe('#addAll', function() { - it('should be possible to add an object with numeric values', function() { + describe('#addAll', function () { + it('should be possible to add an object with numeric values', function () { stats.addAll({ a: 1, b: 2, @@ -71,7 +71,7 @@ describe('statistics', function() { assert.equal(result.a.mean, result.b.mean); }); - it('should be possible to add an array of objects with numeric values', function() { + it('should be possible to add an array of objects with numeric values', function () { let samples = [ { a: 1, @@ -98,8 +98,8 @@ describe('statistics', function() { }); }); - describe('#addDeep', function() { - it('should be possible to add a deep structure', function() { + describe('#addDeep', function () { + it('should be possible to add a deep structure', function () { stats.addDeep({ a: 1, b: { @@ -166,8 +166,8 @@ describe('statistics', function() { }); }); - describe('#summarize', function() { - it('should summarize correctly', function() { + describe('#summarize', function () { + it('should summarize correctly', function () { stats.addAll({ a: 1, b: 2, @@ -193,7 +193,7 @@ describe('statistics', function() { assert.deepEqual(result.a, result.c); }); - it('should summarize specified percentiles', function() { + it('should summarize specified percentiles', function () { stats.addAll({ a: 1, b: 2, diff --git a/test/unitTests/trafficShapeParserTests.js b/test/unitTests/trafficShapeParserTests.js index 96f1b20f9d..391b5d1ac3 100644 --- a/test/unitTests/trafficShapeParserTests.js +++ b/test/unitTests/trafficShapeParserTests.js @@ -3,14 +3,14 @@ let parser = require('../../lib/connectivity/trafficShapeParser'), expect = require('chai').expect; -describe('traffic_shape_parser', function() { - describe('#parseTrafficShapeConfig', function() { +describe('traffic_shape_parser', function () { + describe('#parseTrafficShapeConfig', function () { let profiles = parser.getProfiles(); - Object.keys(profiles).forEach(function(name) { + Object.keys(profiles).forEach(function (name) { let profile = profiles[name]; - it('should return profile for ' + name, function() { + it('should return profile for ' + name, function () { let shapeConfig = parser.parseTrafficShapeConfig({ connectivity: { profile: name } }); @@ -18,14 +18,14 @@ describe('traffic_shape_parser', function() { }); }); - it('should return null for "native" traffic shape config', function() { + it('should return null for "native" traffic shape config', function () { let shapeConfig = parser.parseTrafficShapeConfig({ connectivity: { profile: 'native' } }); expect(shapeConfig).to.equal(null); }); - it('should return undefined if traffic shape config is missing', function() { + it('should return undefined if traffic shape config is missing', function () { let shapeConfig = parser.parseTrafficShapeConfig({}); expect(shapeConfig).to.equal(null); }); diff --git a/test/unitTests/userTimingTests.js b/test/unitTests/userTimingTests.js index 0657b327a0..55bb873d8d 100644 --- a/test/unitTests/userTimingTests.js +++ b/test/unitTests/userTimingTests.js @@ -5,9 +5,9 @@ const assert = require('assert'); const fs = require('fs'); const path = require('path'); -describe('userTiming', function() { - describe('#filterWhitelisted', function() { - it('should filter out entries based on a whitelist', function() { +describe('userTiming', function () { + describe('#filterWhitelisted', function () { + it('should filter out entries based on a whitelist', function () { const timingsFile = path.resolve( __dirname, '..',