Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 730e9d1

Browse files
danjoadimaanj
authored andcommitted
Using cds.User.default in 4.4.4
1 parent d00680f commit 730e9d1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

test/custom-handlers.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { GET, POST, expect } = require('../test') .run ('bookshop')
2-
const cds = require('@sap/cds/lib'); cds.User = cds.User.Privileged // skip auth
2+
const cds = require('@sap/cds/lib')
3+
if (cds.User.default) cds.User.default = cds.User.Privileged // hard core monkey patch
4+
else cds.User = cds.User.Privileged // hard core monkey patch for older cds releases
35

46
describe('Custom Handlers', () => {
57

test/localized-data.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { GET, expect } = require('../test') .run ('serve', 'test/localized-data.cds', '--in-memory')
2-
const cds = require('@sap/cds/lib'); cds.User = cds.User.Privileged // skip auth
2+
const cds = require('@sap/cds/lib')
3+
if (cds.User.default) cds.User.default = cds.User.Privileged // hard core monkey patch
4+
else cds.User = cds.User.Privileged // hard core monkey patch for older cds releases
35

46
describe('Localized Data', () => {
57

test/odata.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { GET, expect } = require('../test') .run ('bookshop')
2-
const cds = require('@sap/cds/lib'); cds.User = cds.User.Privileged // skip auth
2+
const cds = require('@sap/cds/lib')
3+
if (cds.User.default) cds.User.default = cds.User.Privileged // hard core monkey patch
4+
else cds.User = cds.User.Privileged // hard core monkey patch for older cds releases
35

46
describe('OData Protocol', () => {
57

0 commit comments

Comments
 (0)