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

@@ -2,6 +2,7 @@
"name": "@capire/hello-world",
"version": "1.0.0",
"scripts": {
"test": "npx jest --silent",
"watch": "cds serve world.cds",
"watch:ts": "cds-ts serve world.cds"
},

View File

@@ -2,7 +2,7 @@ process.env.CDS_TYPESCRIPT = 'true';
import * as cds from '@sap/cds';
//@ts-ignore
const {GET} = cds.test.in(__dirname,'../hello').run('serve', 'world.cds');
const {GET} = cds.test.in(__dirname,'..').run('serve', 'world.cds');
describe('Hello world!', () => {
afterAll(() => { delete process.env.CDS_TYPESCRIPT; });

View File

@@ -30,7 +30,12 @@
"media": "cds watch media",
"mocha": "npx mocha || echo",
"jest": "npx jest",
"test": "npm run jest --silent"
"test": "npm run jest --silent && npm run test:hello",
"test:hello": "cd hello && npm test"
},
"jest": {
"testEnvironment": "node",
"testMatch": ["**/*.test.js"]
},
"mocha": {
"parallel": true

View File

@@ -7,6 +7,7 @@ Each sub directory essentially is an individual npm package arranged in an [all-
## [@capire/hello-world](hello)
- A simplistic [Hello World](https://cap.cloud.sap/docs/get-started/hello-world) service using [CDS](https://cap.cloud.sap/docs/cds/) and [cds.services](https://cap.cloud.sap/docs/node.js/api#services-api).
- [Typescript support](https://cap.cloud.sap/docs/get-started/using-typescript)
## [@capire/bookshop](bookshop)