Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Make example code use CommonJS require()
Since ESM imports happen before the code is executed, mock-require cannot be used (in theory) to mock ESM modules, unless they are transpiled to CommonJS first. mock-require probably does not support mocking native ES modules in Node.js Eventually, someone may try to run the example using native ES modules, and then complain that it doesn't work. To avoid confusion, let's convert all examples to use CommonJS `require()`.
- Loading branch information