Skip to content

Commit

Permalink
refactor(lib/utils.js): Use quotation methods
Browse files Browse the repository at this point in the history
  • Loading branch information
plroebuck committed Feb 8, 2019
1 parent dceaf8e commit c7c7214
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var debug = require('debug')('mocha:watch');
var fs = require('fs');
var glob = require('glob');
var path = require('path');
var util = require('util');
var join = path.join;
var he = require('he');
var errors = require('./errors');
Expand Down Expand Up @@ -531,7 +532,7 @@ exports.lookupFiles = function lookupFiles(filepath, extensions, recursive) {
files = glob.sync(filepath);
if (!files.length) {
throw createNoFilesMatchPatternError(
'Cannot find any files matching pattern "' + filepath + '"',
'Cannot find any files matching pattern ' + exports.dQuote(filepath),
filepath
);
}
Expand Down Expand Up @@ -565,7 +566,11 @@ exports.lookupFiles = function lookupFiles(filepath, extensions, recursive) {
}
if (!extensions) {
throw createMissingArgumentError(
'Argument "extensions" required when argument "filepath" is a directory',
util.format(
'Argument %s required when argument %s is a directory',
exports.sQuote('extensions'),
exports.sQuote('filepath')
),
'extensions',
'array'
);
Expand Down Expand Up @@ -763,7 +768,7 @@ exports.sQuote = function(str) {
*
* @description
* Provides a simple means of markup for quoting text to be used in output.
* Use this to quote names of datatypes, classes, and strings.
* Use this to quote names of datatypes, classes, pathnames, and strings.
*
* <samp>argument 'value' must be "string" or "number"</samp>
*
Expand Down

0 comments on commit c7c7214

Please sign in to comment.