Skip to content

Commit

Permalink
chore(test): allow persistent outbox (#142)
Browse files Browse the repository at this point in the history
* chore(test): allow persistent outbox

* use in memory db without explicit deploy

* Update jest.config.js
  • Loading branch information
sjvans authored Dec 12, 2023
1 parent c8dac90 commit b47b701
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 3 additions & 0 deletions test/resources/bookshop-graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"kind": "mocked"
}
},
"features": {
"in_memory_db": true
},
"cdsc": {
"docs": true
}
Expand Down
8 changes: 1 addition & 7 deletions test/tests/logger-prod.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,14 @@ describe('graphql - query logging with sanitization in production', () => {
const { gql } = require('../util')
const util = require('util')

const PROJECT_PATH = path.join(__dirname, '../resources/bookshop-graphql')

const { axios, GET, POST, data } = cds.test(PROJECT_PATH)
const { axios, GET, POST, data } = cds.test(path.join(__dirname, '../resources/bookshop-graphql'))
// Prevent axios from throwing errors for non 2xx status codes
axios.defaults.validateStatus = false

const _format = e => util.formatWithOptions({ colors: false, depth: null }, ...(Array.isArray(e) ? e : [e]))

let _log

beforeAll(async () => {
await cds.deploy(path.join(PROJECT_PATH, 'srv'))
})

beforeEach(async () => {
await data.reset()
_log = jest.spyOn(console, 'info')
Expand Down

0 comments on commit b47b701

Please sign in to comment.