@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
21 lines (19 loc) • 634 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createJSONResponse = createJSONResponse;
var _getJsonResponse = require("../shared/get-json-response");
/**
* Internal dependencies
*/
/**
* Respond to a request with a JSON response.
*
* @param {string} mockResponse The mock object to wrap in a JSON response.
* @return {Promise} Promise that responds to a request with the mock JSON response.
*/
function createJSONResponse(mockResponse) {
return async request => request.respond((0, _getJsonResponse.getJSONResponse)(mockResponse));
}
//# sourceMappingURL=create-json-response.js.map