new messaging

This commit is contained in:
D065023
2020-09-15 15:30:14 +02:00
parent 6fdd91b8c8
commit a71aaf75a1
8 changed files with 17 additions and 22 deletions

View File

@@ -1,10 +1,14 @@
const cwd = process.cwd(); process.chdir (__dirname) //> only for internal CI/CD@SAP
const cds = require ('./cds'), {expect} = cds.test
const _model = '@capire/reviews'
let messaging
describe('Messaging', ()=>{
beforeAll(async () => {
messaging = await cds.connect.to('messaging')
})
after(()=> process.chdir(cwd))
it ('should bootstrap sqlite in-memory db', async()=>{
@@ -20,11 +24,11 @@ describe('Messaging', ()=>{
let N=0, received=[], M=0
it ('should add messaging event handlers', ()=>{
srv.on('reviewed', (msg,next)=> { received.push(msg); return next() })
messaging.on('review/reviewed', (msg,next)=> { received.push(msg); return next() })
})
it ('should add more messaging event handlers', ()=>{
srv.on('reviewed', (_,next)=> { ++M; return next() })
messaging.on('review/reviewed', (_,next)=> { ++M; return next() })
})
it ('should add review', async ()=>{