diff --git a/plugin/test/fixtures/v4/functions-without-gatsby-plugin/e2e-tests/test-helpers.js b/plugin/test/fixtures/v4/functions-without-gatsby-plugin/e2e-tests/test-helpers.js index f4a7d3d4..23228678 100644 --- a/plugin/test/fixtures/v4/functions-without-gatsby-plugin/e2e-tests/test-helpers.js +++ b/plugin/test/fixtures/v4/functions-without-gatsby-plugin/e2e-tests/test-helpers.js @@ -115,7 +115,7 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns json correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-json-too`) @@ -124,14 +124,14 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns boolean correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-false`) const result = await res.json() expect(result).toEqual(false) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns status correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-status`) diff --git a/plugin/test/fixtures/v5/functions-without-gatsby-plugin/e2e-tests/test-helpers.js b/plugin/test/fixtures/v5/functions-without-gatsby-plugin/e2e-tests/test-helpers.js index f4a7d3d4..23228678 100644 --- a/plugin/test/fixtures/v5/functions-without-gatsby-plugin/e2e-tests/test-helpers.js +++ b/plugin/test/fixtures/v5/functions-without-gatsby-plugin/e2e-tests/test-helpers.js @@ -115,7 +115,7 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns json correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-json-too`) @@ -124,14 +124,14 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns boolean correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-false`) const result = await res.json() expect(result).toEqual(false) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns status correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-status`) diff --git a/plugin/test/fixtures/v5/with-adapters/e2e-tests/test-helpers.js b/plugin/test/fixtures/v5/with-adapters/e2e-tests/test-helpers.js index 30b4d1ea..437f1f69 100644 --- a/plugin/test/fixtures/v5/with-adapters/e2e-tests/test-helpers.js +++ b/plugin/test/fixtures/v5/with-adapters/e2e-tests/test-helpers.js @@ -117,7 +117,7 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns json correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-json-too`) @@ -126,14 +126,14 @@ exports.runTests = function runTests(env, host) { expect(result).toEqual({ amIJSON: true, }) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns boolean correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-false`) const result = await res.json() expect(result).toEqual(false) - expect(res.headers.get('content-type')).toEqual('application/json') + expect(res.headers.get('content-type')).toMatch(/^application\/json/) }) test(`returns status correctly via send`, async () => { const res = await fetchTwice(`${host}/api/i-am-status`)