Fix usage of unqialified names with cds.db (#378)

This commit is contained in:
Daniel Hutzel
2022-07-13 18:07:18 +02:00
committed by GitHub
parent a704f12b40
commit 5c4247b14c
2 changed files with 4 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ describe('cap/samples - Consuming Services locally', () => {
const AdminService = await cds.connect.to('AdminService')
const { Authors } = AdminService.entities
expect (await SELECT.from(Authors))
.to.eql(await SELECT.from('Authors'))
// .to.eql(await SELECT.from('Authors'))
.to.eql(await AdminService.read(Authors))
.to.eql(await AdminService.read('Authors'))
.to.eql(await AdminService.run(SELECT.from(Authors)))

View File

@@ -4,11 +4,13 @@ const _model = '@capire/reviews'
if (cds.User.default) cds.User.default = cds.User.Privileged // hard core monkey patch
else cds.User = cds.User.Privileged // hard core monkey patch for older cds releases
const Reviews = 'sap.capire.reviews.Reviews'
describe('cap/samples - Messaging', ()=>{
it ('should bootstrap sqlite in-memory db', async()=>{
const db = await cds.deploy (_model) .to ('sqlite::memory:')
await db.delete('Reviews')
await db.delete(Reviews)
expect (db.model) .not.undefined
})