Isolate all TS stuff in hello package

This commit is contained in:
Christian Georgi
2021-07-13 13:22:30 +02:00
parent 47a58e7393
commit 00bfc1507e
6 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
process.env.CDS_TYPESCRIPT = 'true';
import * as cds from '@sap/cds';
//@ts-ignore
const {GET} = cds.test.in(__dirname,'..').run('serve', 'world.cds');
describe('Hello world!', () => {
afterAll(() => { delete process.env.CDS_TYPESCRIPT; });
it('should say hello with class impl from a typescript file', async () => {
const {data} = await GET`/say/hello(to='world')`
expect(data.value).toMatch(/Hello world.*typescript.*/i)
})
})

1
hello/test/test.http Normal file
View File

@@ -0,0 +1 @@
GET http://localhost:4004/say/hello(to='world')