diff --git a/test/tests/graphiql.test.js b/test/tests/graphiql.test.js index b02f662..926926c 100644 --- a/test/tests/graphiql.test.js +++ b/test/tests/graphiql.test.js @@ -6,9 +6,7 @@ describe('graphql - GraphiQL', () => { const { axios, GET } = cds.test(path.join(__dirname, '../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' test('GET request to endpoint should serve HTML containing GraphiQL', async () => { const response = await GET('/graphql') diff --git a/test/tests/http.test.js b/test/tests/http.test.js index 06e3670..bfb670a 100644 --- a/test/tests/http.test.js +++ b/test/tests/http.test.js @@ -26,7 +26,7 @@ describe('GraphQL express json parser error scenario', () => { }) } catch (err) { expect(err.status).toBe(400) - expect(err.response.data.error.message).toMatch(/not valid JSON/) + expect(err.response.data.error.message).toMatch(/JSON/i) expect(_format(_error[0])).toContain('InvalidJSON') } }) diff --git a/test/tests/localized.test.js b/test/tests/localized.test.js index 8c787a8..e0a8518 100644 --- a/test/tests/localized.test.js +++ b/test/tests/localized.test.js @@ -6,9 +6,7 @@ describe('graphql - queries with localized data', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/mutations/create.test.js b/test/tests/mutations/create.test.js index 6d91640..7b69ee0 100644 --- a/test/tests/mutations/create.test.js +++ b/test/tests/mutations/create.test.js @@ -6,9 +6,7 @@ describe('graphql - create mutations', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/mutations/delete.test.js b/test/tests/mutations/delete.test.js index 24b952d..8d22bb5 100644 --- a/test/tests/mutations/delete.test.js +++ b/test/tests/mutations/delete.test.js @@ -6,9 +6,7 @@ describe('graphql - delete mutations', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/mutations/update.test.js b/test/tests/mutations/update.test.js index c4b629d..be134c8 100644 --- a/test/tests/mutations/update.test.js +++ b/test/tests/mutations/update.test.js @@ -6,9 +6,7 @@ describe('graphql - update mutations', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/queries/aliases.test.js b/test/tests/queries/aliases.test.js index a4414eb..a0602ee 100644 --- a/test/tests/queries/aliases.test.js +++ b/test/tests/queries/aliases.test.js @@ -6,9 +6,7 @@ describe('graphql - aliases', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with aliases without connections', () => { diff --git a/test/tests/queries/filter.test.js b/test/tests/queries/filter.test.js index 17ca9e0..69d0222 100644 --- a/test/tests/queries/filter.test.js +++ b/test/tests/queries/filter.test.js @@ -6,9 +6,7 @@ describe('graphql - filter', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/queries/fragments.test.js b/test/tests/queries/fragments.test.js index b217cb2..9a266e2 100644 --- a/test/tests/queries/fragments.test.js +++ b/test/tests/queries/fragments.test.js @@ -6,9 +6,7 @@ describe('graphql - fragments', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with fragments without connections', () => { diff --git a/test/tests/queries/meta.test.js b/test/tests/queries/meta.test.js index cc4814b..a59befb 100644 --- a/test/tests/queries/meta.test.js +++ b/test/tests/queries/meta.test.js @@ -6,9 +6,7 @@ describe('graphql - meta fields', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with __typename meta field without connections', () => { diff --git a/test/tests/queries/orderBy.test.js b/test/tests/queries/orderBy.test.js index 9b1ca98..04a3f61 100644 --- a/test/tests/queries/orderBy.test.js +++ b/test/tests/queries/orderBy.test.js @@ -6,9 +6,7 @@ describe('graphql - orderBy', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with orderBy argument without connections', () => { diff --git a/test/tests/queries/paging-offset.test.js b/test/tests/queries/paging-offset.test.js index 5ce8df7..5ddac72 100644 --- a/test/tests/queries/paging-offset.test.js +++ b/test/tests/queries/paging-offset.test.js @@ -6,9 +6,7 @@ describe('graphql - offset-based paging', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with paging arguments without connections', () => { diff --git a/test/tests/queries/queries.test.js b/test/tests/queries/queries.test.js index a7fbaac..50f59ac 100644 --- a/test/tests/queries/queries.test.js +++ b/test/tests/queries/queries.test.js @@ -6,9 +6,7 @@ describe('graphql - queries', () => { const { axios, POST, data } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' beforeEach(async () => { await data.reset() diff --git a/test/tests/queries/totalCount.test.js b/test/tests/queries/totalCount.test.js index 780217e..7761244 100644 --- a/test/tests/queries/totalCount.test.js +++ b/test/tests/queries/totalCount.test.js @@ -6,9 +6,7 @@ describe('graphql - queries with totalCount', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' test('simple query with totalCount', async () => { const query = gql` diff --git a/test/tests/queries/variables.test.js b/test/tests/queries/variables.test.js index ffe1ff4..c74120f 100644 --- a/test/tests/queries/variables.test.js +++ b/test/tests/queries/variables.test.js @@ -6,9 +6,7 @@ describe('graphql - variables', () => { const { axios, POST } = cds.test(path.join(__dirname, '../../resources/bookshop-graphql')) // Prevent axios from throwing errors for non 2xx status codes axios.defaults.validateStatus = false - axios.defaults.headers = { - authorization: 'Basic YWxpY2U6' - } + axios.defaults.headers.Authorization = 'Basic YWxpY2U6' // REVISIT: unskip for support of configurable schema flavors describe.skip('queries with variables without connections', () => {