Fxed cwd in tests

This commit is contained in:
Daniel
2020-07-23 01:56:56 +02:00
parent aaac6cc678
commit 9a9b7aeb86
2 changed files with 7 additions and 3 deletions

View File

@@ -1,11 +1,13 @@
const { expect } = require('./capire')
const cds = require('@sap/cds')
const cwd = process.cwd()
before (()=> process.chdir(__dirname))
after(()=> process.chdir(cwd))
describe('Consuming Services locally', () => {
//
before('bootstrap db and services', async () => {
process.chdir(__dirname)
const model = await cds.load(['@capire/bookshop', '@capire/common'])
await cds.deploy(model).to('sqlite::memory:')
const { AdminService } = await cds.serve('AdminService').from(model)
@@ -14,8 +16,6 @@ describe('Consuming Services locally', () => {
expect(Authors).not.to.be.undefined
})
after(()=> process.chdir(cwd))
it('bootrapped the database successfully', ()=>{})
it('supports targets as strings or reflected defs', async () => {

View File

@@ -1,3 +1,7 @@
const cwd = process.cwd()
before (()=> process.chdir(__dirname))
after(()=> process.chdir(cwd))
describe('Custom Handlers', () => {
const { GET, POST, expect } = require('./capire').launch('bookshop')