es6/test/api-data-query-nock.js
/**
 * Creates a nock that represents a successful call to data query endpoint.
 */
Creates a nock that represents a successful call to data query endpoint.
Creates a nock that represents a successful call to data query endpoint .
function querySuccess(options) {
  const {
    url, path, auth, response = QUERY_SUCCESS_RESPONSE, query = queryAllowAll,
  } = options
  const scope = nock(url)
    .matchHeader('Accept', CONTENT_TYPE_APPLICATION_JSON)
    .get(path)
    .query(query)
  if (auth) {
    scope.basicAuth(auth)
  }
  return scope.reply(200, response)
}
function querySuccess ( options ) { const { url , path , auth , response = QUERY_SUCCESS_RESPONSE , query = queryAllowAll , } = options const scope = nock ( url ) . matchHeader ( 'Accept' , CONTENT_TYPE_APPLICATION_JSON ) . get ( path ) . query ( query ) if ( auth ) { scope . basicAuth ( auth ) } return scope . reply ( 200 , response ) }
Creates a nock that represents a successful call to data query endpoint.
Creates a nock that represents a successful call to data query endpoint .