[setup][m]: created basis for mocks and config module.
- Added minimal mock for 'package_search' CKAN API. - 'config' module is based on frontend-v2.
This commit is contained in:
32
mocks/index.js
Normal file
32
mocks/index.js
Normal file
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user