Tests
This commit is contained in:
committed by
Christian Georgi
parent
bf2b12e4e8
commit
cae45fcd87
@@ -4,6 +4,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capire/bookstore": "*",
|
"@capire/bookstore": "*",
|
||||||
"@sap/cds": ">=5",
|
"@sap/cds": ">=5",
|
||||||
|
"@sap/cds-odata-v2-adapter-proxy": "^1.8.13",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"passport": ">=0.4.1"
|
"passport": ">=0.4.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
"test:hello": "cd hello && npm test"
|
"test:hello": "cd hello && npm test"
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"testEnvironment": "node",
|
|
||||||
"testTimeout": 20000,
|
"testTimeout": 20000,
|
||||||
"testMatch": [
|
"testMatch": [
|
||||||
"**/*.test.js"
|
"**/*.test.js"
|
||||||
|
|||||||
17
test/fiori.test.js
Normal file
17
test/fiori.test.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
const cds = require('@sap/cds/lib')
|
||||||
|
const { GET, expect, axios } = cds.test ('@capire/fiori', '--with-mocks')
|
||||||
|
axios.defaults.auth = { username: 'alice', password: 'admin' }
|
||||||
|
|
||||||
|
describe('cap/samples - Fiori APIs', () => {
|
||||||
|
|
||||||
|
it('serves $metadata documents in v2', async () => {
|
||||||
|
const { headers, data } = await GET `/v2/browse/$metadata`
|
||||||
|
expect(headers).to.contain({
|
||||||
|
'content-type': 'application/xml',
|
||||||
|
'dataserviceversion': '2.0',
|
||||||
|
})
|
||||||
|
expect(data).to.contain('<EntitySet Name="GenreHierarchy" EntityType="CatalogService.GenreHierarchy"/>')
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user