From e057ccd8be3ff7b0518bd8857887db88b1689009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Thu, 7 Feb 2019 18:35:47 +0100 Subject: [PATCH 1/2] Use example tag --- .../src/mocks/set-up-response-mocking.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js b/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js index 8316ba9046f676..ca32b928def028 100644 --- a/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js +++ b/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js @@ -10,10 +10,13 @@ let requestMocks = []; /** * Sets up mock checks and responses. Accepts a list of mock settings with the following properties: - * - match: function to check if a request should be mocked. - * - onRequestMatch: async function to respond to the request. * - * Example: + * - `match`: function to check if a request should be mocked. + * - `onRequestMatch`: async function to respond to the request. + * + * @example + * + *```js * const MOCK_RESPONSES = [ * { * match: isEmbedding( 'https://wordpress.org/gutenberg/handbook/' ), @@ -25,6 +28,7 @@ let requestMocks = []; * } * ]; * setUpResponseMocking( MOCK_RESPONSES ); + *``` * * If none of the mock settings match the request, the request is allowed to continue. * From 497b4029b313b34e53a2e27d4672cbf1c5dae208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 8 Feb 2019 09:24:04 +0100 Subject: [PATCH 2/2] Adjust spacing --- .../src/mocks/set-up-response-mocking.js | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js b/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js index ca32b928def028..b2ba2d31db0ac7 100644 --- a/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js +++ b/packages/e2e-test-utils/src/mocks/set-up-response-mocking.js @@ -16,19 +16,19 @@ let requestMocks = []; * * @example * - *```js - * const MOCK_RESPONSES = [ - * { - * match: isEmbedding( 'https://wordpress.org/gutenberg/handbook/' ), - * onRequestMatch: JSONResponse( MOCK_BAD_WORDPRESS_RESPONSE ), - * }, - * { - * match: isEmbedding( 'https://wordpress.org/gutenberg/handbook/block-api/attributes/' ), - * onRequestMatch: JSONResponse( MOCK_EMBED_WORDPRESS_SUCCESS_RESPONSE ), - * } - * ]; - * setUpResponseMocking( MOCK_RESPONSES ); - *``` + * ```js + * const MOCK_RESPONSES = [ + * { + * match: isEmbedding( 'https://wordpress.org/gutenberg/handbook/' ), + * onRequestMatch: JSONResponse( MOCK_BAD_WORDPRESS_RESPONSE ), + * }, + * { + * match: isEmbedding( 'https://wordpress.org/gutenberg/handbook/block-api/attributes/' ), + * onRequestMatch: JSONResponse( MOCK_EMBED_WORDPRESS_SUCCESS_RESPONSE ), + * } + * ]; + * setUpResponseMocking( MOCK_RESPONSES ); + * ``` * * If none of the mock settings match the request, the request is allowed to continue. *