- Added minimal mock for 'package_search' CKAN API. - 'config' module is based on frontend-v2.
33 lines
649 B
JavaScript
33 lines
649 B
JavaScript
const nock = require('nock')
|
|
|
|
module.exports.initMocks = function() {
|
|
// Uncomment this line if you want to record API calls
|
|
// nock.recorder.rec()
|
|
|
|
|
|
// "package_search" mocks
|
|
nock('http://mock.ckan/api/3/action')
|
|
.get('/package_search')
|
|
.reply(200, {
|
|
"success": true,
|
|
"result": {
|
|
"count": 2,
|
|
"sort": "score desc, metadata_modified desc",
|
|
"facets": {},
|
|
"results": [
|
|
{
|
|
"name": "gdp"
|
|
},
|
|
{
|
|
"name": "population"
|
|
}
|
|
],
|
|
"search_facets": {}
|
|
}
|
|
})
|
|
|
|
// "package_show" mocks
|
|
|
|
// "organization_show" mocks
|
|
}
|