npm install express-test-utils
expect
requiring just one argument. This occurs since my package relies on jest-expect-message to provide expect messages. To fix this, follow steps in Setup on jest-expect-message's readme. Which pretty much replaces the expect
definition for your projectconst testUtils = require("express-test-utils");
testUtils.testValidationChain(args);
// Or whatever else you wish to do
See documentation linked above for full details
testRequiredBodyValues(paths, body, chain)
tests whether given body values are required by a validation chain
checkForValidationErrors(req, chain, shouldBeNoErrors)
checks for any validation errors against whether a request should pass a chain or not
checkRequestAuthentication(req, auth)
checks if a request passes authentication with given function or not
checkValidationErrors(req, res, chain)
checks for any express-validator validation errors for running the given request through the given chain, returns a Result from express-validator.
Generated using TypeDoc