Skip to content

armgit / mocha

Public Imported from GitHub
0

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

stubbed fs for client

TJ Holowaychukf5c482b218e1
diff --git a/lib/browser/fs.js b/lib/browser/fs.js
new file mode 100644
index 00000000..e69de29b
diff --git a/mocha.js b/mocha.js
index b572a281..1b765f10 100644
--- a/mocha.js
+++ b/mocha.js
@@ -103,6 +103,10 @@ EventEmitter.prototype.emit = function(event){
}); // module: browser/events.js
+require.register("browser/fs.js", function(module, exports, require){
+
+}); // module: browser/fs.js
+
require.register("browser/tty.js", function(module, exports, require){
exports.isatty = function(){
@@ -2290,7 +2294,7 @@ require.register("watch.js", function(module, exports, require){
* Module dependencies.
*/
-var fs = require('fs');
+var fs = require('browser/fs');
module.exports = function(paths, fn){
var options = { interval: 100 };
diff --git a/support/compile.js b/support/compile.js
index 65be223d..9517c4c0 100644
--- a/support/compile.js
+++ b/support/compile.js
@@ -45,6 +45,7 @@ function parseRequires(js) {
return js
.replace(/require\('events'\)/g, "require('browser/events')")
.replace(/require\('tty'\)/g, "require('browser/tty')")
+ .replace(/require\('fs'\)/g, "require('browser/fs')")
}
/**