using cds.test

This commit is contained in:
Daniel
2021-08-30 16:04:54 +02:00
committed by Daniel Hutzel
parent 2be3d50389
commit 2f5d159428
9 changed files with 16 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
const { GET, expect } = require('../test') .run ('bookshop')
const cds = require('@sap/cds/lib')
const { GET, expect } = cds.test ('@capire/bookshop')
if (cds.User.default) cds.User.default = cds.User.Privileged // hard core monkey patch
else cds.User = cds.User.Privileged // hard core monkey patch for older cds releases
@@ -18,9 +18,9 @@ describe('OData Protocol', () => {
})
it('supports $search in multiple fields', async () => {
const { data } = await GET(`/browse/Books`, {
const { data } = await GET `/browse/Books ${{
params: { $search: 'Po', $select: `title,author` },
})
}}`
expect(data.value).to.eql([
{ ID: 201, title: 'Wuthering Heights', author: 'Emily Brontë' },
{ ID: 207, title: 'Jane Eyre', author: 'Charlotte Brontë' },