diff --git a/lib/doctest.js b/lib/doctest.js index 339b2544..8a396d81 100644 --- a/lib/doctest.js +++ b/lib/doctest.js @@ -172,6 +172,7 @@ case 'commonjs': return iifeWrap(unlines([ 'var __doctest = {', + ' require: require,', ' queue: [],', ' enqueue: function(io) { this.queue.push(io); }', '};', diff --git a/test/index.js b/test/index.js index 8a01e8f8..724def7e 100644 --- a/test/index.js +++ b/test/index.js @@ -249,6 +249,7 @@ testCommand( stdout: unlines([ 'void function() {', ' var __doctest = {', + ' require: require,', ' queue: [],', ' enqueue: function(io) { this.queue.push(io); }', ' };',