Skip to content

Commit

Permalink
Merge pull request #83 from davidchambers/require
Browse files Browse the repository at this point in the history
expose ‘require’ as ‘__doctest.require’
  • Loading branch information
davidchambers authored Dec 21, 2017
2 parents f2bfbee + ec4d7eb commit 2894f1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/doctest.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
case 'commonjs':
return iifeWrap(unlines([
'var __doctest = {',
' require: require,',
' queue: [],',
' enqueue: function(io) { this.queue.push(io); }',
'};',
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ testCommand(
stdout: unlines([
'void function() {',
' var __doctest = {',
' require: require,',
' queue: [],',
' enqueue: function(io) { this.queue.push(io); }',
' };',
Expand Down

0 comments on commit 2894f1c

Please sign in to comment.