-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to modules that instant executing a required module. require('./something')() This mock-fn-as-callback-style was used in test found in npm/cli: t.test('mock as callback style', t => { t.mock('../my-module.js', { '../sub-module.js': arg => { t.equal(arg, 'expected') t.end() } }) }) Also added more varied situations to stress test the module replacement, such as using t.mock within one of the defined mocks, require calls at execution time along with tests for the mock as callback style.
- Loading branch information
Showing
3 changed files
with
89 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters