Comparing version 10.8.0 to 10.8.1
@@ -184,4 +184,20 @@ 'use strict'; | ||
if (filepath) { | ||
let configData; | ||
try { | ||
const pkg = JSON.parse(fs.readFileSync(filepath, 'utf8')); | ||
configData = fs.readFileSync(filepath, 'utf8'); | ||
} catch (err) { | ||
// If `args.package` was explicitly specified, throw an error | ||
if (filepath == args.package) { | ||
throw createUnparsableFileError( | ||
`Unable to read ${filepath}: ${err}`, | ||
filepath | ||
); | ||
} else { | ||
debug('failed to read default package.json at %s; ignoring', | ||
filepath); | ||
return result; | ||
} | ||
} | ||
try { | ||
const pkg = JSON.parse(configData); | ||
if (pkg.mocha) { | ||
@@ -194,9 +210,7 @@ debug('`mocha` prop of package.json parsed: %O', pkg.mocha); | ||
} catch (err) { | ||
if (args.package) { | ||
throw createUnparsableFileError( | ||
`Unable to read/parse ${filepath}: ${err}`, | ||
filepath | ||
); | ||
} | ||
debug('failed to read default package.json at %s; ignoring', filepath); | ||
// If JSON failed to parse, throw an error. | ||
throw createUnparsableFileError( | ||
`Unable to parse ${filepath}: ${err}`, | ||
filepath | ||
); | ||
} | ||
@@ -203,0 +217,0 @@ } |
@@ -297,3 +297,3 @@ 'use strict'; | ||
'grep=' + | ||
encodeURIComponent(escapeRe(s)) | ||
encodeURIComponent(s) | ||
); | ||
@@ -308,3 +308,3 @@ } | ||
HTML.prototype.suiteURL = function (suite) { | ||
return makeUrl(suite.fullTitle()); | ||
return makeUrl('^' + escapeRe(suite.fullTitle()) + ' '); | ||
}; | ||
@@ -318,3 +318,3 @@ | ||
HTML.prototype.testURL = function (test) { | ||
return makeUrl(test.fullTitle()); | ||
return makeUrl('^' + escapeRe(test.fullTitle()) + '$'); | ||
}; | ||
@@ -321,0 +321,0 @@ |
{ | ||
"name": "mocha", | ||
"version": "10.8.0", | ||
"version": "10.8.1", | ||
"type": "commonjs", | ||
@@ -5,0 +5,0 @@ "description": "simple, flexible, fun test framework", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2128018
30602