Add module mocking functionality #1140
Labels
effort-high
This will take a while
enhancement
A new or improved feature
priority-medium
This should get done, but it's not a high priority
Intern should provide an out-of-the-box solution for module mocking. The system should work with at least the Node loader and webpack, and it should provide type safety.
The mocking system currently used for Intern's self tests would probably work:
The snippet above dynamically imports a module, replacing certain of that modules imports with mock values. These imports are type safe, which is why the
as any
is required for the MockErrorFormatter mock, which doesn't completely mock ErrorFormatter.The built in mocking system should be optional, and it shouldn't get in the way if the user wants to use something else.
The text was updated successfully, but these errors were encountered: