Fix tests to run with mocha (#389)

This commit is contained in:
Daniel Hutzel
2022-08-15 14:11:52 +02:00
committed by GitHub
parent 2a37ef8be1
commit 8ab66b4130
10 changed files with 53 additions and 51 deletions

View File

@@ -1,20 +1,18 @@
const cds = require('@sap/cds/lib')
const {expect} = cds.test
// should become cds.compile(...) when cds5 is released
const model = cds.compile.to.csn (`
entity Categories {
key ID : Integer;
name : String;
children : Composition of many Categories on children.parent = $self;
parent : Association to Categories;
}
`)
const {Categories:Cats} = model.definitions
describe('cap/samples - Hierarchical Data', ()=>{
const model = CDL`
entity Categories {
key ID : Integer;
name : String;
children : Composition of many Categories on children.parent = $self;
parent : Association to Categories;
}
`
const {Categories:Cats} = model.definitions
const {expect} = cds.test
before ('bootstrap sqlite in-memory db...', async()=>{
await cds.deploy (model) .to ('sqlite::memory:')
expect (cds.db) .to.exist