joke
joke copied to clipboard
Typesafe mock utility with minimal boilerplate for jest
As the project changes, a lot of mocks can remain that are not even called in the scope of the test suite. I wonder if in this project, we could...
We need type tests, possibly across ts versions, to confirm that types generated for mock functions/classes have correct types.
tsconfig needs to enable es2020+ for dynamic imports. Module resolution `node` is probably recommended, not sure why anybody would use `classic`.
Perhaps it's better to annotate magical imports with a `.macro` suffix to make them less confusing (although more verbose). Perhaps the module name for the macro can be shortened to...