☕️ Classic, reliable, trusted test framework for Node.js and the browser
Fixed require() leak spotted by [guillermo]
Tj Holowaychukf38bfd59a54a
diff --git a/.gitignore b/.gitignoreindex fbb64d6a..4154cb7f 100644--- a/.gitignore+++ b/.gitignore@@ -2,3 +2,4 @@node_modules*.socktesting+_mocha.jsdiff --git a/Makefile b/Makefileindex 4c3da634..49c30016 100644--- a/Makefile+++ b/Makefile@@ -11,7 +11,7 @@ mocha.css: test/browser/style.cssmocha.js: $(SRC)@node support/compile $^- @cat support/tail.js >> mocha.js+ @cat support/head.js _mocha.js support/{tail,foot}.js > mocha.jsclean:rm -f mocha.{js,css}diff --git a/mocha.js b/mocha.jsindex 27b6f812..ba7029f7 100644--- a/mocha.js+++ b/mocha.js@@ -1,3 +1,5 @@+;(function(){+// CommonJS require()@@ -2528,3 +2530,4 @@ mocha = require('mocha');return runner.run();};})();+})();\ No newline at end of filediff --git a/support/compile.js b/support/compile.jsindex 74c3128f..66161311 100644--- a/support/compile.js+++ b/support/compile.js@@ -80,7 +80,7 @@ function compile() {buf += js;buf += '\n}); // module: ' + file + '\n';});- fs.writeFile('mocha.js', buf, function(err){+ fs.writeFile('_mocha.js', buf, function(err){if (err) throw err;console.log(' \033[90m create : \033[0m\033[36m%s\033[0m', 'mocha.js');console.log();diff --git a/support/foot.js b/support/foot.jsnew file mode 100644index 00000000..158693a0--- /dev/null+++ b/support/foot.js@@ -0,0 +1 @@+})();\ No newline at end of filediff --git a/support/head.js b/support/head.jsnew file mode 100644index 00000000..aad8ad25--- /dev/null+++ b/support/head.js@@ -0,0 +1,2 @@+;(function(){+