Skip to content

Commit 60bc653

Browse files
Deprecate --compilers
1 parent 228dc47 commit 60bc653

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: bin/_mocha

+10
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,16 @@ if (program.forbidPending) mocha.forbidPending();
346346

347347
// custom compiler support
348348

349+
if (program.compilers.length > 0) {
350+
require("util").deprecate(function () {}, [
351+
"`--compilers` is likely to be replaced in a future version of Mocha.",
352+
"Instead use `--require` to load the compiler and add your file extension(s) to your filepath globs.",
353+
"To glob for multiple file extensions, \"quote\" the path and use `@(one|the-other)`, e.g. \"test/**/*.spec.@(js|coffee)\""
354+
]
355+
.concat(program.watch ? ["With `--watch`, also add the extensions through `--watch-extensions`"] : [])
356+
.join("\n")
357+
)()
358+
}
349359
var extensions = ['js'];
350360
program.compilers.forEach(function (c) {
351361
var idx = c.indexOf(':');

0 commit comments

Comments
 (0)