This commit is contained in:
Christian Georgi
2022-06-21 15:52:40 +02:00
committed by Christian Georgi
parent bf2b12e4e8
commit cae45fcd87
3 changed files with 18 additions and 1 deletions

View File

@@ -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"
}, },

View File

@@ -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
View 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"/>')
})
})