Simplify hello world sample
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
service say @(path: '/say') {
|
service say {
|
||||||
function hello (to:String) returns String;
|
function hello (to:String) returns String;
|
||||||
}
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
const cds = require ('@sap/cds')
|
|
||||||
describe('Hello world!', () => {
|
|
||||||
const {GET} = cds.test.in(__dirname,'../srv').run('serve', 'world.cds')
|
|
||||||
|
|
||||||
it('should say hello with class impl', async () => {
|
|
||||||
const {data} = await GET`/say/hello(to='world')`
|
|
||||||
expect(data.value).to.match(/Hello world.*typescript.*/i)
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
@@ -1 +1,5 @@
|
|||||||
GET http://localhost:4004/say/hello(to='world')
|
GET http://localhost:4004/odata/v4/say/hello
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://localhost:4004/odata/v4/say/hello(to='me')
|
||||||
|
###
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ describe('cap/samples - Hello world!', () => {
|
|||||||
const { GET, expect } = cds.test (__dirname+'/../hello')
|
const { GET, expect } = cds.test (__dirname+'/../hello')
|
||||||
|
|
||||||
it('should say hello with class impl', async () => {
|
it('should say hello with class impl', async () => {
|
||||||
const {data} = await GET `/say/hello(to='world')`
|
const {data} = await GET `/odata/v4/say/hello(to='world')`
|
||||||
expect(data.value).to.eql('Hello world!')
|
expect(data.value).to.eql('Hello world!')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user