fixed support for mocha

This commit is contained in:
Daniel
2022-01-04 13:53:52 +01:00
committed by Daniel Hutzel
parent 788a101f41
commit a8345122ea
7 changed files with 48 additions and 21 deletions

View File

@@ -1,15 +1,13 @@
const cds = require('@sap/cds/lib')
const { expect } = cds.test (
'serve', 'AdminService', '--from', '@capire/bookshop,@capire/common', '--in-memory'
)
const { expect } = cds.test ('@capire/bookshop')
describe('Consuming Services locally', () => {
//
it('bootstrapped the database successfully', ()=>{
const { AdminService } = cds.services
const { Authors } = AdminService.entities
expect(AdminService).not.to.be.undefined
expect(Authors).not.to.be.undefined
expect(AdminService).to.exist
expect(Authors).to.exist
})
it('supports targets as strings or reflected defs', async () => {
@@ -39,6 +37,7 @@ describe('Consuming Services locally', () => {
name: 'Emily Brontë',
books: [
{
ID: 201,
title: 'Wuthering Heights',
currency: { name: 'British Pound', symbol: '£' },
},
@@ -47,8 +46,8 @@ describe('Consuming Services locally', () => {
{
name: 'Edgar Allen Poe',
books: [
{ title: 'The Raven', currency: { name: 'US Dollar', symbol: '$' } },
{ title: 'Eleonora', currency: { name: 'US Dollar', symbol: '$' } },
{ ID: 251, title: 'The Raven', currency: { name: 'US Dollar', symbol: '$' } },
{ ID: 252, title: 'Eleonora', currency: { name: 'US Dollar', symbol: '$' } },
],
},
])