From f287659a042022601fa1296e85eca4f817ba9eec Mon Sep 17 00:00:00 2001 From: Shane Osbourne Date: Wed, 26 Apr 2023 16:22:19 +0100 Subject: [PATCH] tweak width --- packages/browser-sync/lib/async.js | 24 ++- packages/browser-sync/lib/bin.ts | 4 +- packages/browser-sync/lib/cli/cli-info.js | 3 +- packages/browser-sync/lib/cli/cli-options.ts | 5 +- .../browser-sync/lib/cli/command.recipe.js | 5 +- .../transforms/addDefaultIgnorePatterns.ts | 9 +- packages/browser-sync/lib/config.js | 3 +- packages/browser-sync/lib/connect-utils.js | 7 +- packages/browser-sync/lib/default-config.js | 10 +- packages/browser-sync/lib/file-watcher.js | 6 +- packages/browser-sync/lib/http-protocol.js | 12 +- packages/browser-sync/lib/internal-events.js | 26 +-- packages/browser-sync/lib/lodash.custom.js | 168 +++++++++++++----- packages/browser-sync/lib/logger.js | 10 +- packages/browser-sync/lib/options.ts | 8 +- packages/browser-sync/lib/server/utils.js | 27 ++- packages/browser-sync/lib/snippet.js | 5 +- packages/browser-sync/lib/utils.ts | 7 +- packages/browser-sync/package.json | 2 +- .../browser-sync/test/specs/cli/cli.exec.js | 5 +- .../browser-sync/test/specs/cli/cli.help.js | 11 +- .../test/specs/commands/recipes.js | 11 +- .../test/specs/e2e/cli/e2e.cli.conf.js | 5 +- .../test/specs/e2e/cli/e2e.cli.server.js | 28 ++- .../test/specs/e2e/e2e.options.cors.js | 10 +- .../test/specs/e2e/e2e.options.scriptpath.js | 20 ++- .../test/specs/e2e/e2e.options.serveStatic.js | 5 +- .../e2e.server.serveStatic.extensions.js | 5 +- .../e2e/server/e2e.server.serveStatic.js | 15 +- .../specs/e2e/server/e2e.server.tunnel.js | 5 +- .../test/specs/http-protocol/http.reload.js | 15 +- .../test/specs/resp-mod/rewrite-links.js | 17 +- .../test/specs/utils/utils.connect.js | 21 ++- 33 files changed, 393 insertions(+), 121 deletions(-) diff --git a/packages/browser-sync/lib/async.js b/packages/browser-sync/lib/async.js index 8c57b5b87..8273dc680 100644 --- a/packages/browser-sync/lib/async.js +++ b/packages/browser-sync/lib/async.js @@ -90,7 +90,10 @@ module.exports = { require("dns").resolve("www.google.com", function(err) { var online = false; if (err) { - bs.debug("Could not resolve www.google.com, setting %s", chalk.magenta("online: false")); + bs.debug( + "Could not resolve www.google.com, setting %s", + chalk.magenta("online: false") + ); } else { bs.debug("Resolved www.google.com, setting %s", chalk.magenta("online: true")); online = true; @@ -141,9 +144,15 @@ module.exports = { done(null, { options: { urls: utils.getUrlOptions(bs.options), - snippet: connectUtils.enabled(bs.options) ? connectUtils.scriptTags(bs.options) : false, + snippet: connectUtils.enabled(bs.options) + ? connectUtils.scriptTags(bs.options) + : false, scriptPaths: Immutable.fromJS(connectUtils.clientScript(bs.options, true)), - files: bs.pluginManager.hook("files:watch", bs.options.get("files"), bs.pluginManager.pluginOptions) + files: bs.pluginManager.hook( + "files:watch", + bs.options.get("files"), + bs.pluginManager.pluginOptions + ) } }); }, @@ -224,7 +233,10 @@ module.exports = { * @param {Function} done */ startSockets: function(bs, done) { - var clientEvents = bs.pluginManager.hook("client:events", bs.options.get("clientEvents").toJS()); + var clientEvents = bs.pluginManager.hook( + "client:events", + bs.options.get("clientEvents").toJS() + ); // Start the socket, needs an existing server. var io = bs.pluginManager.get("socket")(bs.server, clientEvents, bs); @@ -259,7 +271,9 @@ module.exports = { return item.name === PLUGIN_NAME; }) ) { - uiOpts = bs.options.get("ui").mergeDeep(Immutable.fromJS(bs.pluginManager.pluginOptions[PLUGIN_NAME])); + uiOpts = bs.options + .get("ui") + .mergeDeep(Immutable.fromJS(bs.pluginManager.pluginOptions[PLUGIN_NAME])); } /** diff --git a/packages/browser-sync/lib/bin.ts b/packages/browser-sync/lib/bin.ts index 6114ee8e9..fa5dd3163 100755 --- a/packages/browser-sync/lib/bin.ts +++ b/packages/browser-sync/lib/bin.ts @@ -128,7 +128,9 @@ function handleNoCommand(argv, input, yargs) { return process.exit(1); } - const serveStaticPaths = withoutErrors.filter(item => item.isUrl === false).map(item => item.resolved); + const serveStaticPaths = withoutErrors + .filter(item => item.isUrl === false) + .map(item => item.resolved); const urls = withoutErrors.filter(item => item.isUrl === true).map(item => item.userInput); diff --git a/packages/browser-sync/lib/cli/cli-info.js b/packages/browser-sync/lib/cli/cli-info.js index 5719068f2..2ed1f781f 100644 --- a/packages/browser-sync/lib/cli/cli-info.js +++ b/packages/browser-sync/lib/cli/cli-info.js @@ -48,7 +48,8 @@ var info = { fs.writeFile(path.resolve(cwd, config.userFile), file, function() { logger.info("Config file created %s", chalk.magenta(config.userFile)); logger.info( - "To use it, in the same directory run: " + chalk.cyan("browser-sync start --config bs-config.js") + "To use it, in the same directory run: " + + chalk.cyan("browser-sync start --config bs-config.js") ); cb(); }); diff --git a/packages/browser-sync/lib/cli/cli-options.ts b/packages/browser-sync/lib/cli/cli-options.ts index 5a780190e..1c49bdb71 100644 --- a/packages/browser-sync/lib/cli/cli-options.ts +++ b/packages/browser-sync/lib/cli/cli-options.ts @@ -128,7 +128,10 @@ export function printErrors(errors: BsErrors) { `Error Type: ${error.type}`, `Error Level: ${error.level}`, error.errors.map(item => - [`Error Message: ${item.error.message}`, item.meta ? item.meta().join("\n") : ""] + [ + `Error Message: ${item.error.message}`, + item.meta ? item.meta().join("\n") : "" + ] .filter(Boolean) .join("\n") ) diff --git a/packages/browser-sync/lib/cli/command.recipe.js b/packages/browser-sync/lib/cli/command.recipe.js index 02537de6c..2ba34d867 100644 --- a/packages/browser-sync/lib/cli/command.recipe.js +++ b/packages/browser-sync/lib/cli/command.recipe.js @@ -20,7 +20,10 @@ module.exports = function(opts) { var logRecipes = function() { var dirs = fs.readdirSync(path.join(dir, "recipes")); - logger.info("Install one of the following with %s\n", chalk.cyan("browser-sync recipe ")); + logger.info( + "Install one of the following with %s\n", + chalk.cyan("browser-sync recipe ") + ); dirs.forEach(function(name) { console.log(" " + name); }); diff --git a/packages/browser-sync/lib/cli/transforms/addDefaultIgnorePatterns.ts b/packages/browser-sync/lib/cli/transforms/addDefaultIgnorePatterns.ts index 40b373c5e..ab6b2529a 100644 --- a/packages/browser-sync/lib/cli/transforms/addDefaultIgnorePatterns.ts +++ b/packages/browser-sync/lib/cli/transforms/addDefaultIgnorePatterns.ts @@ -1,7 +1,14 @@ import { List } from "immutable"; import { BsTempOptions, TransformResult } from "../cli-options"; -const defaultIgnorePatterns = [/node_modules/, /bower_components/, ".sass-cache", ".vscode", ".git", ".idea"]; +const defaultIgnorePatterns = [ + /node_modules/, + /bower_components/, + ".sass-cache", + ".vscode", + ".git", + ".idea" +]; export function addDefaultIgnorePatterns(incoming: BsTempOptions): TransformResult { if (!incoming.get("watch")) { diff --git a/packages/browser-sync/lib/config.js b/packages/browser-sync/lib/config.js index cd641decc..ee26d7ab2 100644 --- a/packages/browser-sync/lib/config.js +++ b/packages/browser-sync/lib/config.js @@ -26,6 +26,7 @@ module.exports = { }, errors: { "server+proxy": "Invalid config. You cannot specify both server & proxy options.", - "proxy+https": "Invalid config. You set https: true, but your proxy target doesn't reflect this." + "proxy+https": + "Invalid config. You set https: true, but your proxy target doesn't reflect this." } }; diff --git a/packages/browser-sync/lib/connect-utils.js b/packages/browser-sync/lib/connect-utils.js index 26cb47bd5..81d908818 100644 --- a/packages/browser-sync/lib/connect-utils.js +++ b/packages/browser-sync/lib/connect-utils.js @@ -39,7 +39,12 @@ var connectUtils = { */ var scriptSrc = (function() { if (options.get("localOnly")) { - return [options.get("scheme"), "://localhost:", options.get("port"), scriptPath].join(""); + return [ + options.get("scheme"), + "://localhost:", + options.get("port"), + scriptPath + ].join(""); } /** diff --git a/packages/browser-sync/lib/default-config.js b/packages/browser-sync/lib/default-config.js index 64e8fe4ef..eca62e1c9 100644 --- a/packages/browser-sync/lib/default-config.js +++ b/packages/browser-sync/lib/default-config.js @@ -512,7 +512,15 @@ module.exports = { */ timestamps: true, - clientEvents: ["scroll", "scroll:element", "input:text", "input:toggles", "form:submit", "form:reset", "click"], + clientEvents: [ + "scroll", + "scroll:element", + "input:text", + "input:toggles", + "form:submit", + "form:reset", + "click" + ], /** * Alter the script path for complete control over where the Browsersync diff --git a/packages/browser-sync/lib/file-watcher.js b/packages/browser-sync/lib/file-watcher.js index fbd0f0a5e..d0a88234b 100644 --- a/packages/browser-sync/lib/file-watcher.js +++ b/packages/browser-sync/lib/file-watcher.js @@ -42,7 +42,11 @@ module.exports.plugin = function(bs) { if (!_.isFunction(item.fn)) { item.fn = fn; } - var watcher = watch(item.match, item.options || defaultWatchOptions, item.fn.bind(bs.publicInstance)); + var watcher = watch( + item.match, + item.options || defaultWatchOptions, + item.fn.bind(bs.publicInstance) + ); if (!map[namespace]) { map[namespace] = { watchers: [watcher] diff --git a/packages/browser-sync/lib/http-protocol.js b/packages/browser-sync/lib/http-protocol.js index 620832d39..7e74178fe 100644 --- a/packages/browser-sync/lib/http-protocol.js +++ b/packages/browser-sync/lib/http-protocol.js @@ -4,7 +4,13 @@ var queryString = require("qs"); var proto = exports; var instanceMethods = ["exit", "notify", "pause", "resume"]; var getBody = require("raw-body"); -const permittedSocketEvents = ["file:reload", "browser:reload", "browser:notify", "browser:location", "options:set"]; +const permittedSocketEvents = [ + "file:reload", + "browser:reload", + "browser:notify", + "browser:location", + "options:set" +]; /** * Does the requested method expect an instance of BrowserSync @@ -49,7 +55,9 @@ proto.middleware = function(bs) { try { const [name, payload] = JSON.parse(body.toString()); bs.io.sockets.emit(name, payload); - return res.end(`Browsersync HTTP Protocol received: ${name} ${JSON.stringify(payload)}`); + return res.end( + `Browsersync HTTP Protocol received: ${name} ${JSON.stringify(payload)}` + ); } catch (e) { const output = [`Error: ${e.message}`]; res.writeHead(500, { "Content-Type": "text/plain" }); diff --git a/packages/browser-sync/lib/internal-events.js b/packages/browser-sync/lib/internal-events.js index 7bba9661c..29d87b0f4 100644 --- a/packages/browser-sync/lib/internal-events.js +++ b/packages/browser-sync/lib/internal-events.js @@ -92,18 +92,20 @@ module.exports = function(bs) { return x.namespace === "core"; }); - var handler = fileHandler.fileChanges(coreNamespacedWatchers, bs.options).subscribe(function(x) { - if (x.type === "reload") { - bs.events.emit("browser:reload", x); - } - if (x.type === "inject") { - x.files.forEach(function(data) { - if (!bs.paused && data.namespace === "core") { - bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options)); - } - }); - } - }); + var handler = fileHandler + .fileChanges(coreNamespacedWatchers, bs.options) + .subscribe(function(x) { + if (x.type === "reload") { + bs.events.emit("browser:reload", x); + } + if (x.type === "inject") { + x.files.forEach(function(data) { + if (!bs.paused && data.namespace === "core") { + bs.events.emit("file:reload", fileUtils.getFileInfo(data, bs.options)); + } + }); + } + }); bs.registerCleanupTask(function() { handler.dispose(); diff --git a/packages/browser-sync/lib/lodash.custom.js b/packages/browser-sync/lib/lodash.custom.js index c524cef34..070892ec6 100644 --- a/packages/browser-sync/lib/lodash.custom.js +++ b/packages/browser-sync/lib/lodash.custom.js @@ -137,9 +137,19 @@ var reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = - "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", + "(?:" + + rsZWJ + + "(?:" + + [rsNonAstral, rsRegional, rsSurrPair].join("|") + + ")" + + rsOptVar + + reOptMod + + ")*", rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + rsSymbol = + "(?:" + + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + + ")"; /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); @@ -149,30 +159,36 @@ /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[ - int16Tag - ] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[ - uint16Tag - ] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[ - boolTag - ] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[ - funcTag - ] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[ + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[ + int8Tag + ] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[ + uint8Tag + ] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[ + uint32Tag + ] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[ + arrayBufferTag + ] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[ + dateTag + ] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[ + mapTag + ] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[ regexpTag ] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[ - dataViewTag - ] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[ - float64Tag - ] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[ - mapTag - ] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[ - setTag - ] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[ + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[ + arrayBufferTag + ] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[ + dateTag + ] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[ + int8Tag + ] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[ + numberTag + ] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[ + stringTag + ] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[ uint8ClampedTag ] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; @@ -193,7 +209,8 @@ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var freeModule = + freeExports && typeof module == "object" && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; @@ -475,7 +492,9 @@ * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { - return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } /** @@ -1441,7 +1460,8 @@ // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == "offset" || key == "parent")) || // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == "buffer" || key == "byteLength" || key == "byteOffset")) || + (isType && + (key == "buffer" || key == "byteLength" || key == "byteOffset")) || // Skip index properties. isIndex(key, length)) ) @@ -1462,7 +1482,10 @@ * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { - if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { + if ( + (value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object)) + ) { baseAssignValue(object, key, value); } } @@ -1479,7 +1502,10 @@ */ function assignValue(object, key, value) { var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { + if ( + !(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object)) + ) { baseAssignValue(object, key, value); } } @@ -1746,7 +1772,9 @@ if (value == null) { return value === undefined ? undefinedTag : nullTag; } - return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + return symToStringTag && symToStringTag in Object(value) + ? getRawTag(value) + : objectToString(value); } /** @@ -2101,7 +2129,9 @@ assignMergeValue(object, key, stacked); return; } - var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined; + var newValue = customizer + ? customizer(objValue, srcValue, key + "", object, source, stack) + : undefined; var isCommon = newValue === undefined; @@ -2472,7 +2502,9 @@ while (++index < length) { var key = props[index]; - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; if (newValue === undefined) { newValue = source[key]; @@ -2524,7 +2556,10 @@ customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined; + customizer = + assigner.length > 3 && typeof customizer == "function" + ? (length--, customizer) + : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; @@ -2663,7 +2698,8 @@ !arraySome(other, function(othValue, othIndex) { if ( !cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack)) + (arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack)) ) { return seen.push(othIndex); } @@ -2672,7 +2708,12 @@ result = false; break; } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + } else if ( + !( + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + ) + ) { result = false; break; } @@ -2702,7 +2743,10 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: - if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + if ( + object.byteLength != other.byteLength || + object.byteOffset != other.byteOffset + ) { return false; } object = object.buffer; @@ -2753,7 +2797,14 @@ // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); - var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + var result = equalArrays( + convert(object), + convert(other), + bitmask, + customizer, + equalFunc, + stack + ); stack["delete"](object); return result; @@ -2818,7 +2869,8 @@ // Recursively compare objects (susceptible to call stack limits). if ( !(compared === undefined - ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) + ? objValue === othValue || + equalFunc(objValue, othValue, bitmask, customizer, stack) : compared) ) { result = false; @@ -3066,7 +3118,12 @@ return result; } length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + return ( + !!length && + isLength(length) && + isIndex(key, length) && + (isArray(object) || isArguments(object)) + ); } /** @@ -3096,7 +3153,9 @@ * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { - return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; + return typeof object.constructor == "function" && !isPrototype(object) + ? baseCreate(getPrototype(object)) + : {}; } /** @@ -3162,7 +3221,11 @@ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + return ( + isArray(value) || + isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]) + ); } /** @@ -3220,10 +3283,20 @@ return false; } var type = typeof value; - if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + if ( + type == "number" || + type == "symbol" || + type == "boolean" || + value == null || + isSymbol(value) + ) { return true; } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); + return ( + reIsPlainProp.test(value) || + !reIsDeepProp.test(value) || + (object != null && value in Object(object)) + ); } /** @@ -3863,7 +3936,9 @@ * // => false */ function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + return ( + typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER + ); } /** @@ -3961,7 +4036,11 @@ return true; } var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + return ( + typeof Ctor == "function" && + Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString + ); } /** @@ -3982,7 +4061,10 @@ * // => false */ function isString(value) { - return typeof value == "string" || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); + return ( + typeof value == "string" || + (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag) + ); } /** diff --git a/packages/browser-sync/lib/logger.js b/packages/browser-sync/lib/logger.js index 544b8bb3b..bac8a6359 100644 --- a/packages/browser-sync/lib/logger.js +++ b/packages/browser-sync/lib/logger.js @@ -46,7 +46,10 @@ module.exports.callbacks = { "file:reload": function(bs, data) { if (canLogFileChange(bs, data)) { if (data.path[0] === "*") { - return logger.info(chalk.cyan("Reloading files that match: %s"), chalk.magenta(data.path)); + return logger.info( + chalk.cyan("Reloading files that match: %s"), + chalk.magenta(data.path) + ); } logger.info(chalk.cyan("File event [%s] : %s"), data.event, chalk.magenta(data.path)); @@ -64,7 +67,10 @@ module.exports.callbacks = { "browser:reload": function(bs, data = {}) { if (canLogFileChange(bs)) { if (data.files && data.files.length > 1) { - return logger.info(chalk.cyan(`Reloading Browsers... (buffered %s events)`), data.files.length); + return logger.info( + chalk.cyan(`Reloading Browsers... (buffered %s events)`), + data.files.length + ); } logger.info(chalk.cyan("Reloading Browsers...")); } diff --git a/packages/browser-sync/lib/options.ts b/packages/browser-sync/lib/options.ts index 1781b8981..48fd38605 100644 --- a/packages/browser-sync/lib/options.ts +++ b/packages/browser-sync/lib/options.ts @@ -96,7 +96,13 @@ export function setNamespace(incoming: BsTempOptions): TransformResult { var namespace = incoming.getIn(["socket", "namespace"]); if (_.isFunction(namespace)) { - return [incoming.setIn(["socket", "namespace"], namespace((defaultConfig.socket as any).namespace)), []]; + return [ + incoming.setIn( + ["socket", "namespace"], + namespace((defaultConfig.socket as any).namespace) + ), + [] + ]; } return [incoming, []]; } diff --git a/packages/browser-sync/lib/server/utils.js b/packages/browser-sync/lib/server/utils.js index bbf42f165..1688fd3c5 100644 --- a/packages/browser-sync/lib/server/utils.js +++ b/packages/browser-sync/lib/server/utils.js @@ -122,7 +122,11 @@ var serverUtils = { options: bs.options }); - var scripts = bs.pluginManager.get("client:script")(bs.options.toJS(), clientJs, "middleware"); + var scripts = bs.pluginManager.get("client:script")( + bs.options.toJS(), + clientJs, + "middleware" + ); var defaultMiddlewares = [ { @@ -192,7 +196,11 @@ var serverUtils = { if (withErrors.size) { withErrors.forEach(function(item) { - logger.logger.error("%s %s", chalk.red("Warning!"), item.getIn(["errors", 0, "data", "message"])); + logger.logger.error( + "%s %s", + chalk.red("Warning!"), + item.getIn(["errors", 0, "data", "message"]) + ); }); } @@ -229,7 +237,9 @@ var serverUtils = { } ); - const mwStack = [].concat(beforeMiddlewares, defaultMiddlewares, afterMiddlewares).filter(Boolean); + const mwStack = [] + .concat(beforeMiddlewares, defaultMiddlewares, afterMiddlewares) + .filter(Boolean); return mwStack; @@ -282,7 +292,9 @@ var serverUtils = { // Snippet if (bs.options.get("snippet")) { - rules.push(snippetUtils.getRegex(bs.options.get("snippet"), bs.options.get("snippetOptions"))); + rules.push( + snippetUtils.getRegex(bs.options.get("snippet"), bs.options.get("snippetOptions")) + ); } // User @@ -297,7 +309,9 @@ var serverUtils = { // Proxy if (bs.options.get("proxy")) { - var proxyRule = require("./proxy-utils").rewriteLinks(bs.options.getIn(["proxy", "url"]).toJS()); + var proxyRule = require("./proxy-utils").rewriteLinks( + bs.options.getIn(["proxy", "url"]).toJS() + ); rules.push(proxyRule); } @@ -424,7 +438,8 @@ var serverUtils = { { type: "Invalid Object", data: { - message: "Serve Static requires a 'dir' property when using an Object" + message: + "Serve Static requires a 'dir' property when using an Object" } } ] diff --git a/packages/browser-sync/lib/snippet.js b/packages/browser-sync/lib/snippet.js index ca347d2d2..dfc64b54a 100644 --- a/packages/browser-sync/lib/snippet.js +++ b/packages/browser-sync/lib/snippet.js @@ -91,7 +91,10 @@ var snippetUtils = { getClientJs: function(port, options) { return () => { const script = options.get("minify") ? "index.js" : "index.js"; - const client = fs.readFileSync(require.resolve("browser-sync-client/dist/" + script), "utf8"); + const client = fs.readFileSync( + require.resolve("browser-sync-client/dist/" + script), + "utf8" + ); return [connectUtils.socketConnector(options), client].join(";\n"); }; } diff --git a/packages/browser-sync/lib/utils.ts b/packages/browser-sync/lib/utils.ts index 84c2b22ea..71356fc69 100644 --- a/packages/browser-sync/lib/utils.ts +++ b/packages/browser-sync/lib/utils.ts @@ -129,7 +129,12 @@ export function getPorts(options: BsTempOptions, cb: PortLookupCb) { fn(host, port, max, cb); } -export function getPort(host: string, port: number | string, max: number | string | null, cb: PortLookupCb) { +export function getPort( + host: string, + port: number | string, + max: number | string | null, + cb: PortLookupCb +) { portScanner.findAPortNotInUse( port, max, diff --git a/packages/browser-sync/package.json b/packages/browser-sync/package.json index ceff4b107..586146a76 100644 --- a/packages/browser-sync/package.json +++ b/packages/browser-sync/package.json @@ -23,7 +23,7 @@ "prettier": { "tabWidth": 4, "singleQuote": false, - "printWidth": 120 + "printWidth": 100 }, "scripts": { "build": "npm run build:server", diff --git a/packages/browser-sync/test/specs/cli/cli.exec.js b/packages/browser-sync/test/specs/cli/cli.exec.js index 9d35eb8fa..377949e98 100644 --- a/packages/browser-sync/test/specs/cli/cli.exec.js +++ b/packages/browser-sync/test/specs/cli/cli.exec.js @@ -1,7 +1,10 @@ describe("CLI: exec", function() { this.timeout(10000); it("Can launch from cli", function(done) { - var strem = require("child_process").spawn("node", [require.resolve("../../../dist/bin"), "start"]); + var strem = require("child_process").spawn("node", [ + require.resolve("../../../dist/bin"), + "start" + ]); var chunks = []; strem.stdout.on("data", function(data) { chunks.push(data.toString()); diff --git a/packages/browser-sync/test/specs/cli/cli.help.js b/packages/browser-sync/test/specs/cli/cli.help.js index 626cae1e9..aef19c93c 100644 --- a/packages/browser-sync/test/specs/cli/cli.help.js +++ b/packages/browser-sync/test/specs/cli/cli.help.js @@ -4,7 +4,10 @@ const recipeOpts = require("../../../cli-options/opts.recipe.json"); const reloadOpts = require("../../../cli-options/opts.reload.json"); function assertHelpOutput(args, cond, done) { - const stream = require("child_process").spawn("node", [require.resolve("../../../dist/bin")].concat(args)); + const stream = require("child_process").spawn( + "node", + [require.resolve("../../../dist/bin")].concat(args) + ); const chunks = []; stream.stdout.on("data", function(data) { chunks.push(data.toString()); @@ -25,7 +28,11 @@ describe("CLI: showing help", function() { assertHelpOutput(["--help"], text => text.includes(startOpts.serveStatic.desc), done); }); it("start --help", function(done) { - assertHelpOutput(["start", "--help"], text => text.includes(startOpts.serveStatic.desc), done); + assertHelpOutput( + ["start", "--help"], + text => text.includes(startOpts.serveStatic.desc), + done + ); }); it("init --help", function(done) { assertHelpOutput(["init", "--help"], text => text.includes("Usage: "), done); diff --git a/packages/browser-sync/test/specs/commands/recipes.js b/packages/browser-sync/test/specs/commands/recipes.js index 09a0cc6c4..3812f2ec3 100644 --- a/packages/browser-sync/test/specs/commands/recipes.js +++ b/packages/browser-sync/test/specs/commands/recipes.js @@ -66,7 +66,10 @@ describe("E2E CLI `recipes` command", function() { } }, cb: function(err) { - assert.equal(err.message, "Target folder exists remove it first and then try again"); + assert.equal( + err.message, + "Target folder exists remove it first and then try again" + ); done(); } }); @@ -87,7 +90,11 @@ describe("E2E CLI `recipes` command", function() { var call1 = stub1.getCall(0).args; assert.equal(call1[0], "Recipe copied into %s"); assert.equal(call1[1], chalk.cyan(dir)); - sinon.assert.calledWith(stub1, "Next, inside that folder, run %s", chalk.cyan("npm i && npm start")); + sinon.assert.calledWith( + stub1, + "Next, inside that folder, run %s", + chalk.cyan("npm i && npm start") + ); logger.info.restore(); done(); } diff --git a/packages/browser-sync/test/specs/e2e/cli/e2e.cli.conf.js b/packages/browser-sync/test/specs/e2e/cli/e2e.cli.conf.js index 11407ddcd..ea4881c43 100644 --- a/packages/browser-sync/test/specs/e2e/cli/e2e.cli.conf.js +++ b/packages/browser-sync/test/specs/e2e/cli/e2e.cli.conf.js @@ -40,7 +40,10 @@ describe("CLI: reading config file from disk", function() { }, cb: function(err, bs) { var err = stub.getCall(0).args[1]; - assert.equal(err.message, "Configuration file 'test/fixtures/config/sioops.js' not found"); + assert.equal( + err.message, + "Configuration file 'test/fixtures/config/sioops.js' not found" + ); utils.fail.restore(); bs.cleanup(); done(); diff --git a/packages/browser-sync/test/specs/e2e/cli/e2e.cli.server.js b/packages/browser-sync/test/specs/e2e/cli/e2e.cli.server.js index d7f05be5f..32030f5a0 100644 --- a/packages/browser-sync/test/specs/e2e/cli/e2e.cli.server.js +++ b/packages/browser-sync/test/specs/e2e/cli/e2e.cli.server.js @@ -82,7 +82,10 @@ describe("E2E CLI server test with directory listing/index ", function() { }); it("Sets the correct server options", function() { assert.equal(instance.options.getIn(["server", "directory"]), true); - assert.equal(instance.options.getIn(["server", "serveStaticOptions", "index"]), "index.htm"); + assert.equal( + instance.options.getIn(["server", "serveStaticOptions", "index"]), + "index.htm" + ); }); }); @@ -113,8 +116,14 @@ describe("E2E CLI server test with extensions option - single", function() { instance.cleanup(); }); it("Sets the extensions option (array) for serve static", function() { - assert.equal(instance.options.getIn(["server", "serveStaticOptions", "index"]), "index.html"); - assert.deepEqual(instance.options.getIn(["server", "serveStaticOptions", "extensions"]).toJS(), ["html"]); + assert.equal( + instance.options.getIn(["server", "serveStaticOptions", "index"]), + "index.html" + ); + assert.deepEqual( + instance.options.getIn(["server", "serveStaticOptions", "extensions"]).toJS(), + ["html"] + ); }); }); @@ -145,10 +154,13 @@ describe("E2E CLI server test with extensions option - multiple", function() { instance.cleanup(); }); it("Sets the extensions option (array) for serve static", function() { - assert.equal(instance.options.getIn(["server", "serveStaticOptions", "index"]), "index.html"); - assert.deepEqual(instance.options.getIn(["server", "serveStaticOptions", "extensions"]).toJS(), [ - "html", - "css" - ]); + assert.equal( + instance.options.getIn(["server", "serveStaticOptions", "index"]), + "index.html" + ); + assert.deepEqual( + instance.options.getIn(["server", "serveStaticOptions", "extensions"]).toJS(), + ["html", "css"] + ); }); }); diff --git a/packages/browser-sync/test/specs/e2e/e2e.options.cors.js b/packages/browser-sync/test/specs/e2e/e2e.options.cors.js index d31a5d789..43190eee3 100644 --- a/packages/browser-sync/test/specs/e2e/e2e.options.cors.js +++ b/packages/browser-sync/test/specs/e2e/e2e.options.cors.js @@ -21,8 +21,14 @@ describe("e2e options test (cors)", function() { .expect(200) .end(function(err, res) { assert.equal(res.headers["access-control-allow-origin"], "*"); - assert.equal(res.headers["access-control-allow-methods"], "GET, POST, OPTIONS, PUT, PATCH, DELETE"); - assert.equal(res.headers["access-control-allow-headers"], "X-Requested-With,content-type"); + assert.equal( + res.headers["access-control-allow-methods"], + "GET, POST, OPTIONS, PUT, PATCH, DELETE" + ); + assert.equal( + res.headers["access-control-allow-headers"], + "X-Requested-With,content-type" + ); assert.equal(res.headers["access-control-allow-credentials"], "true"); bs.cleanup(); done(); diff --git a/packages/browser-sync/test/specs/e2e/e2e.options.scriptpath.js b/packages/browser-sync/test/specs/e2e/e2e.options.scriptpath.js index 0e69a3e04..0b072312a 100644 --- a/packages/browser-sync/test/specs/e2e/e2e.options.scriptpath.js +++ b/packages/browser-sync/test/specs/e2e/e2e.options.scriptpath.js @@ -17,7 +17,10 @@ describe("E2E script path test - given a callback", function() { } }; browserSync(config, function(err, bs) { - assert.include(bs.options.get("snippet"), "localhost:PORT/browser-sync/browser-sync-client."); + assert.include( + bs.options.get("snippet"), + "localhost:PORT/browser-sync/browser-sync-client." + ); bs.cleanup(); done(); }); @@ -50,7 +53,10 @@ describe("E2E Socket namespace test - given a string", function() { .get(instance.options.getIn(["scriptPaths", "path"])) .expect(200) .end(function(err, res) { - assert.include(res.text, "___browserSync___.socketUrl = '' + location.host + '/TEST';"); + assert.include( + res.text, + "___browserSync___.socketUrl = '' + location.host + '/TEST';" + ); done(); }); }); @@ -79,7 +85,10 @@ describe("E2E script path test - Using absolute path", function() { }); it("Sets the script path", function() { - assert.include(instance.options.get("snippet"), "http://HOST:3000/browser-sync/browser-sync-client."); + assert.include( + instance.options.get("snippet"), + "http://HOST:3000/browser-sync/browser-sync-client." + ); }); }); @@ -107,6 +116,9 @@ describe("E2E script path test - Using absolute path + secure server", function( }); it("Sets the script path", function() { - assert.include(instance.options.get("snippet"), "https://HOST:3000/browser-sync/browser-sync-client."); + assert.include( + instance.options.get("snippet"), + "https://HOST:3000/browser-sync/browser-sync-client." + ); }); }); diff --git a/packages/browser-sync/test/specs/e2e/e2e.options.serveStatic.js b/packages/browser-sync/test/specs/e2e/e2e.options.serveStatic.js index ceabb5330..bf89177cc 100644 --- a/packages/browser-sync/test/specs/e2e/e2e.options.serveStatic.js +++ b/packages/browser-sync/test/specs/e2e/e2e.options.serveStatic.js @@ -64,7 +64,10 @@ describe("E2E `serveStatic` option", function() { var config = { logLevel: "silent", online: false, - serveStatic: [{ route: "", dir: "test/fixtures" }, { route: [""], dir: "test/fixtures/assets" }] + serveStatic: [ + { route: "", dir: "test/fixtures" }, + { route: [""], dir: "test/fixtures/assets" } + ] }; browserSync(config, function(err, bs) { var reqs = getRequests([["/index.html", page], ["/style.css", css]], bs.server); diff --git a/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.extensions.js b/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.extensions.js index 6dc2619d4..ab6a741df 100644 --- a/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.extensions.js +++ b/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.extensions.js @@ -20,7 +20,10 @@ describe("E2E server test with extension option", function() { }; browserSync.create().init(config, function(err, bs) { - assert.equal(bs.options.getIn(["server", "serveStaticOptions", "extensions", 0]), "html"); + assert.equal( + bs.options.getIn(["server", "serveStaticOptions", "extensions", 0]), + "html" + ); var reqs = utils.getRequests( [["/forms", require("fs").readFileSync("test/fixtures/forms.html", "utf-8")]], bs.server diff --git a/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.js b/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.js index 4b2fca575..b26baf550 100644 --- a/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.js +++ b/packages/browser-sync/test/specs/e2e/server/e2e.server.serveStatic.js @@ -18,12 +18,18 @@ describe("E2E server test with serve static options", function() { }; browserSync.create().init(config, function(err, bs) { - assert.equal(bs.options.getIn(["server", "serveStaticOptions", "index"]), "inputs.html"); + assert.equal( + bs.options.getIn(["server", "serveStaticOptions", "index"]), + "inputs.html" + ); request(bs.server) .get("/") .expect(200) .end(function(err, res) { - assert.deepEqual(require("fs").readFileSync("test/fixtures/inputs.html", "utf-8"), res.text); + assert.deepEqual( + require("fs").readFileSync("test/fixtures/inputs.html", "utf-8"), + res.text + ); bs.cleanup(); done(); }); @@ -47,7 +53,10 @@ describe("E2E server test with serve static options", function() { .get("/") .expect(200) .end(function(err, res) { - assert.deepEqual(require("fs").readFileSync("test/fixtures/index.html", "utf-8"), res.text); + assert.deepEqual( + require("fs").readFileSync("test/fixtures/index.html", "utf-8"), + res.text + ); bs.cleanup(); done(); }); diff --git a/packages/browser-sync/test/specs/e2e/server/e2e.server.tunnel.js b/packages/browser-sync/test/specs/e2e/server/e2e.server.tunnel.js index b97a508f2..21f71b5a3 100644 --- a/packages/browser-sync/test/specs/e2e/server/e2e.server.tunnel.js +++ b/packages/browser-sync/test/specs/e2e/server/e2e.server.tunnel.js @@ -95,7 +95,10 @@ describe("Tunnel e2e tests with Error", function() { }; browserSync(config, function(err, bs) { - bs.tunnel.emit("error", new Error("connection refused: (check your firewall settings)")); + bs.tunnel.emit( + "error", + new Error("connection refused: (check your firewall settings)") + ); bs.cleanup(); done(); }); diff --git a/packages/browser-sync/test/specs/http-protocol/http.reload.js b/packages/browser-sync/test/specs/http-protocol/http.reload.js index ccb50d249..7ac5ef941 100644 --- a/packages/browser-sync/test/specs/http-protocol/http.reload.js +++ b/packages/browser-sync/test/specs/http-protocol/http.reload.js @@ -46,7 +46,10 @@ describe("HTTP protocol", function() { }); }); it("responds to reload event with multi file paths", function(done) { - var url = proto.getUrl({ method: "reload", args: ["a.css", "b.css"] }, bs.options.getIn(["urls", "local"])); + var url = proto.getUrl( + { method: "reload", args: ["a.css", "b.css"] }, + bs.options.getIn(["urls", "local"]) + ); request(url, function(e, r, body) { scheduler.advanceTo(500); @@ -65,7 +68,10 @@ describe("HTTP protocol", function() { }); }); it("responds to reload event with single file path", function(done) { - var url = proto.getUrl({ method: "reload", args: "somefile.php" }, bs.options.getIn(["urls", "local"])); + var url = proto.getUrl( + { method: "reload", args: "somefile.php" }, + bs.options.getIn(["urls", "local"]) + ); request(url, function(e, r, body) { scheduler.advanceTo(500); @@ -82,7 +88,10 @@ describe("HTTP protocol", function() { }); }); it("Gives a nice error when method not found", function(done) { - var url = proto.getUrl({ method: "relzoad", args: "somefile.php" }, bs.options.getIn(["urls", "local"])); + var url = proto.getUrl( + { method: "relzoad", args: "somefile.php" }, + bs.options.getIn(["urls", "local"]) + ); request(url, function(e, r, body) { assert.equal(r.statusCode, 404); diff --git a/packages/browser-sync/test/specs/resp-mod/rewrite-links.js b/packages/browser-sync/test/specs/resp-mod/rewrite-links.js index 83f161ccb..c9b8afc9a 100644 --- a/packages/browser-sync/test/specs/resp-mod/rewrite-links.js +++ b/packages/browser-sync/test/specs/resp-mod/rewrite-links.js @@ -127,7 +127,9 @@ describe("Rewriting Domains", function() { assert.equal(actual, expected); }); it("should use the regex to replace links that contain hashes (1)", function() { - var actual = testRegex(""); + var actual = testRegex( + "" + ); var expected = ""; assert.equal(actual, expected); }); @@ -139,7 +141,10 @@ describe("Rewriting Domains", function() { it("should use the regex to replace links that contain hashes (2)", function() { var input = fs.readFileSync("test/fixtures/rewrites/hashes.input.html", "utf8"); var expected = fs.readFileSync("test/fixtures/rewrites/hashes.expected.html", "utf8"); - var rewrite = utils.rewriteLinks({ hostname: "www.example.local.colinr.com", port: 80 }, proxyUrl); + var rewrite = utils.rewriteLinks( + { hostname: "www.example.local.colinr.com", port: 80 }, + proxyUrl + ); var bound = rewrite.fn.bind(null, { headers: { host: proxyUrl } }, {}); var actual = input.replace(rewrite.match, bound); assert.equal(actual, expected); @@ -164,7 +169,8 @@ describe("Rewriting Domains", function() { assert.equal(actual, expected); }); it("should use the regex to replace links that contain port + ", function() { - var input = ''; + var input = + ''; var rewrite = utils.rewriteLinks({ hostname: "mclinic" }, proxyUrl); var bound = rewrite.fn.bind(null, { headers: { host: proxyUrl } }, {}); var actual = input.replace(rewrite.match, bound); @@ -218,7 +224,10 @@ describe("Rewriting Domains", function() { }); it("handles escaped urls correctly", function() { var input = fs.readFileSync("test/fixtures/rewrites/escaped.1.html", "utf8"); - var expected = fs.readFileSync("test/fixtures/rewrites/escaped.1.expected.html", "utf8"); + var expected = fs.readFileSync( + "test/fixtures/rewrites/escaped.1.expected.html", + "utf8" + ); var rewrite = utils.rewriteLinks({ hostname: "demo.l5" }, proxyUrl); var bound = rewrite.fn.bind(null, { headers: { host: proxyUrl } }, {}); var actual = input.replace(rewrite.match, bound); diff --git a/packages/browser-sync/test/specs/utils/utils.connect.js b/packages/browser-sync/test/specs/utils/utils.connect.js index 8d9ee8a4d..a1914af1a 100644 --- a/packages/browser-sync/test/specs/utils/utils.connect.js +++ b/packages/browser-sync/test/specs/utils/utils.connect.js @@ -135,7 +135,10 @@ describe("Connection snippetUtils", function() { } }); var actual = utils.socketConnector(options); - assert.include(actual, "___browserSync___.socketUrl = '' + location.host + '/browser-sync';"); + assert.include( + actual, + "___browserSync___.socketUrl = '' + location.host + '/browser-sync';" + ); }); it("E2E Should allow setting of socket.domain + script.domain as strings", function(done) { bs.reset(); @@ -182,10 +185,13 @@ describe("Connection snippetUtils", function() { var port = bs.options.get("port"); assert.include( bs.options.get("snippet"), - '