File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
v4/functions-without-gatsby-plugin/e2e-tests
functions-without-gatsby-plugin/e2e-tests Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ exports.runTests = function runTests(env, host) {
115
115
expect ( result ) . toEqual ( {
116
116
amIJSON : true ,
117
117
} )
118
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
118
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
119
119
} )
120
120
test ( `returns json correctly via send` , async ( ) => {
121
121
const res = await fetchTwice ( `${ host } /api/i-am-json-too` )
@@ -124,14 +124,14 @@ exports.runTests = function runTests(env, host) {
124
124
expect ( result ) . toEqual ( {
125
125
amIJSON : true ,
126
126
} )
127
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
127
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
128
128
} )
129
129
test ( `returns boolean correctly via send` , async ( ) => {
130
130
const res = await fetchTwice ( `${ host } /api/i-am-false` )
131
131
const result = await res . json ( )
132
132
133
133
expect ( result ) . toEqual ( false )
134
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
134
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
135
135
} )
136
136
test ( `returns status correctly via send` , async ( ) => {
137
137
const res = await fetchTwice ( `${ host } /api/i-am-status` )
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ exports.runTests = function runTests(env, host) {
115
115
expect ( result ) . toEqual ( {
116
116
amIJSON : true ,
117
117
} )
118
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
118
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
119
119
} )
120
120
test ( `returns json correctly via send` , async ( ) => {
121
121
const res = await fetchTwice ( `${ host } /api/i-am-json-too` )
@@ -124,14 +124,14 @@ exports.runTests = function runTests(env, host) {
124
124
expect ( result ) . toEqual ( {
125
125
amIJSON : true ,
126
126
} )
127
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
127
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
128
128
} )
129
129
test ( `returns boolean correctly via send` , async ( ) => {
130
130
const res = await fetchTwice ( `${ host } /api/i-am-false` )
131
131
const result = await res . json ( )
132
132
133
133
expect ( result ) . toEqual ( false )
134
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
134
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
135
135
} )
136
136
test ( `returns status correctly via send` , async ( ) => {
137
137
const res = await fetchTwice ( `${ host } /api/i-am-status` )
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ exports.runTests = function runTests(env, host) {
117
117
expect ( result ) . toEqual ( {
118
118
amIJSON : true ,
119
119
} )
120
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
120
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
121
121
} )
122
122
test ( `returns json correctly via send` , async ( ) => {
123
123
const res = await fetchTwice ( `${ host } /api/i-am-json-too` )
@@ -126,14 +126,14 @@ exports.runTests = function runTests(env, host) {
126
126
expect ( result ) . toEqual ( {
127
127
amIJSON : true ,
128
128
} )
129
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
129
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
130
130
} )
131
131
test ( `returns boolean correctly via send` , async ( ) => {
132
132
const res = await fetchTwice ( `${ host } /api/i-am-false` )
133
133
const result = await res . json ( )
134
134
135
135
expect ( result ) . toEqual ( false )
136
- expect ( res . headers . get ( 'content-type' ) ) . toEqual ( ' application/json' )
136
+ expect ( res . headers . get ( 'content-type' ) ) . toMatch ( / ^ a p p l i c a t i o n \ /j s o n / )
137
137
} )
138
138
test ( `returns status correctly via send` , async ( ) => {
139
139
const res = await fetchTwice ( `${ host } /api/i-am-status` )
You can’t perform that action at this time.
0 commit comments