@@ -1,11 +1,13 @@
|
|||||||
const { expect } = require('./capire')
|
const { expect } = require('./capire')
|
||||||
const cds = require('@sap/cds')
|
const cds = require('@sap/cds')
|
||||||
|
|
||||||
const cwd = process.cwd()
|
const cwd = process.cwd()
|
||||||
|
before (()=> process.chdir(__dirname))
|
||||||
|
after(()=> process.chdir(cwd))
|
||||||
|
|
||||||
describe('Consuming Services locally', () => {
|
describe('Consuming Services locally', () => {
|
||||||
//
|
//
|
||||||
before('bootstrap db and services', async () => {
|
before('bootstrap db and services', async () => {
|
||||||
process.chdir(__dirname)
|
|
||||||
const model = await cds.load(['@capire/bookshop', '@capire/common'])
|
const model = await cds.load(['@capire/bookshop', '@capire/common'])
|
||||||
await cds.deploy(model).to('sqlite::memory:')
|
await cds.deploy(model).to('sqlite::memory:')
|
||||||
const { AdminService } = await cds.serve('AdminService').from(model)
|
const { AdminService } = await cds.serve('AdminService').from(model)
|
||||||
@@ -14,8 +16,6 @@ describe('Consuming Services locally', () => {
|
|||||||
expect(Authors).not.to.be.undefined
|
expect(Authors).not.to.be.undefined
|
||||||
})
|
})
|
||||||
|
|
||||||
after(()=> process.chdir(cwd))
|
|
||||||
|
|
||||||
it('bootrapped the database successfully', ()=>{})
|
it('bootrapped the database successfully', ()=>{})
|
||||||
|
|
||||||
it('supports targets as strings or reflected defs', async () => {
|
it('supports targets as strings or reflected defs', async () => {
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
const cwd = process.cwd()
|
||||||
|
const is_jest = !!global.test
|
||||||
|
if (is_jest) { // it's jest
|
||||||
|
global.before = (msg,fn) => global.beforeAll(fn||msg)
|
||||||
|
global.after = (msg,fn) => global.afterAll(fn||msg)
|
||||||
|
}
|
||||||
|
before (()=> process.chdir(__dirname))
|
||||||
|
after (()=> process.chdir(cwd))
|
||||||
|
|
||||||
describe('Custom Handlers', () => {
|
describe('Custom Handlers', () => {
|
||||||
const { GET, POST, expect } = require('./capire').launch('bookshop')
|
const { GET, POST, expect } = require('./capire').launch('bookshop')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user