From 29f195103b15a9677d7ac9df63f329f5366222bc Mon Sep 17 00:00:00 2001 From: D050513 Date: Fri, 8 Dec 2023 12:17:56 +0100 Subject: [PATCH 1/3] chore(test): allow persistent outbox --- jest.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jest.config.js b/jest.config.js index 4c4b200f..d74d04c4 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,6 @@ +// FIXME: this should not brake the tests +process.env.CDS_REQUIRES_OUTBOX = true + const config = { testTimeout: 10000 } From 130aef459b67d84a194b096e17475f8a13eaefc2 Mon Sep 17 00:00:00 2001 From: D050513 Date: Mon, 11 Dec 2023 11:27:31 +0100 Subject: [PATCH 2/3] use in memory db without explicit deploy --- test/resources/bookshop-graphql/package.json | 3 +++ test/tests/logger-prod.test.js | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/resources/bookshop-graphql/package.json b/test/resources/bookshop-graphql/package.json index 34b9d665..feae891a 100644 --- a/test/resources/bookshop-graphql/package.json +++ b/test/resources/bookshop-graphql/package.json @@ -14,6 +14,9 @@ "kind": "mocked" } }, + "features": { + "in_memory_db": true + }, "cdsc": { "docs": true } diff --git a/test/tests/logger-prod.test.js b/test/tests/logger-prod.test.js index 707c28ed..c67bcd97 100644 --- a/test/tests/logger-prod.test.js +++ b/test/tests/logger-prod.test.js @@ -5,9 +5,7 @@ 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 @@ -15,10 +13,6 @@ describe('graphql - query logging with sanitization in production', () => { let _log - beforeAll(async () => { - await cds.deploy(path.join(PROJECT_PATH, 'srv')) - }) - beforeEach(async () => { await data.reset() _log = jest.spyOn(console, 'info') From 294e9da88823fe0324459f94f3abe556d1e2ac9a Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Mon, 11 Dec 2023 11:28:46 +0100 Subject: [PATCH 3/3] Update jest.config.js --- jest.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index d74d04c4..4c4b200f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,6 +1,3 @@ -// FIXME: this should not brake the tests -process.env.CDS_REQUIRES_OUTBOX = true - const config = { testTimeout: 10000 }