Skip to content

Commit de998cf

Browse files
committed
improved tests
1 parent 5db3a8a commit de998cf

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.vscode/launch.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
52
"version": "0.2.0",
63
"configurations": [
74
{
8-
"name": "bookshop",
9-
"command": "npx cds watch bookshop",
10-
"type": "node-terminal",
5+
"name": "vscode-jest-tests.v2",
116
"request": "launch",
7+
"type": "node", "runtimeExecutable": "jest",
8+
"experimentalNetworking": "off",
9+
"args": [
10+
"${relativeFile}",
11+
"-i", "--test-timeout", "1e6",
12+
"-t", "${jest.testNamePattern}",
13+
],
1214
"skipFiles": [
1315
"<node_internals>/**",
1416
"**/node_modules/**",
15-
]
17+
"**/express/**",
18+
"**/jasmine/**",
19+
"**/jest/**",
20+
"**/cds/lib/req/cds-context.js",
21+
],
1622
},
1723
]
1824
}

jest.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export default {
2+
transform: {},
23
silent: true
34
}

tests/messaging.test.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
const cds = require('@sap/cds')
2-
const { expect } = cds.test.in(__dirname,'..')
2+
const { expect } = cds.test
3+
cds.User.default = cds.User.Privileged // hard core monkey patch
34

45
describe('cap/samples - Messaging', ()=>{
56

67
const _model = '@capire/reviews'
78
const Reviews = 'sap.capire.reviews.Reviews'
8-
beforeAll(()=>{
9-
cds.User.default = cds.User.Privileged // hard core monkey patch
10-
})
119

1210
it ('should bootstrap sqlite in-memory db', async()=>{
1311
const db = await cds.deploy (_model) .to ('sqlite::memory:')

0 commit comments

Comments
 (0)