Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fixes #100 Allow --globals to be used multiple times

Brendan Neee8bf1b3e2021
diff --git a/bin/_mocha b/bin/_mocha
index 031bc535..0eecac29 100755
--- a/bin/_mocha
+++ b/bin/_mocha
@@ -61,6 +61,14 @@ program
program.name = 'mocha';
+// --globals
+
+var globals = [];
+program.on('globals', function(){
+ globals = globals.concat(program.globals);
+ program.globals = globals;
+});
+
// --reporters
program.on('reporters', function(){