Next, let's test our create engine function. Like our previous createUser request handler, the src/engines/users/create/index.js module contains two import statements, which makes it difficult to test. Therefore, just like before, we must pull these dependencies out, and import them back into src/index.js:
import createUserValidator from './validators/users/create';...const handlerToValidatorMap = new Map([ [createUserHandler, createUserValidator],]);...app.post('/users', injectHandlerDependencies(createUserHandler, client, handlerToEngineMap, handlerToValidatorMap, ValidationError));
Then, update the injectHandlerDependencies function to inject the validator function into the handler:
function injectHandlerDependencies( ...