UNPKG

@wordpress/e2e-test-utils

Version:
21 lines (19 loc) 634 B
"use strict"; 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