Parameterised tests for Jest that enable running the same test multiple times with different data sets using arrays or tagged template literals
85
Build a testing utility that automatically mocks an external module and tracks all method invocations for verification in tests.
Your implementation should:
@generates
/**
* Creates a call tracker that mocks the specified module
*
* @param {string} modulePath - Path to the module to mock
* @returns {object} Tracker interface
*/
function createTracker(modulePath) {
// Returns an object with:
// - getMock(): returns the mocked module
// - getCallsFor(methodName): returns array of call arguments arrays
// - getCallCount(methodName): returns number of times method was called
// - reset(): clears all mock call history
}
module.exports = { createTracker };Provides testing framework with module mocking capabilities including automatic module mocking, mock function creation, and call tracking.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-jest-eachdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10