[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:
anuveyatsu
2020-06-11 19:10:34 +06:00
parent 9bb98ce6d3
commit b477a3aace
5 changed files with 8678 additions and 1 deletions

32
mocks/index.js Normal file
View 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
}