@@ -79,20 +79,24 @@ test('merging two groups of merged instances', withServer, async (t, server) =>
79
79
test ( 'hooks are merged' , t => {
80
80
const getBeforeRequestHooks = ( instance : Got ) : BeforeRequestHook [ ] => instance . defaults . options . hooks . beforeRequest ;
81
81
82
- const instanceA = got . extend ( { hooks : {
83
- beforeRequest : [
84
- options => {
85
- options . headers . dog = 'woof' ;
86
- } ,
87
- ] ,
88
- } } ) ;
89
- const instanceB = got . extend ( { hooks : {
90
- beforeRequest : [
91
- options => {
92
- options . headers . cat = 'meow' ;
93
- } ,
94
- ] ,
95
- } } ) ;
82
+ const instanceA = got . extend ( {
83
+ hooks : {
84
+ beforeRequest : [
85
+ options => {
86
+ options . headers . dog = 'woof' ;
87
+ } ,
88
+ ] ,
89
+ } ,
90
+ } ) ;
91
+ const instanceB = got . extend ( {
92
+ hooks : {
93
+ beforeRequest : [
94
+ options => {
95
+ options . headers . cat = 'meow' ;
96
+ } ,
97
+ ] ,
98
+ } ,
99
+ } ) ;
96
100
97
101
const merged = instanceA . extend ( instanceB ) ;
98
102
t . deepEqual ( getBeforeRequestHooks ( merged ) , [ ...getBeforeRequestHooks ( instanceA ) , ...getBeforeRequestHooks ( instanceB ) ] ) ;
@@ -118,13 +122,17 @@ test('URL is not polluted', withServer, async (t, server, got) => {
118
122
} ) ;
119
123
120
124
test ( 'merging instances with HTTPS options' , t => {
121
- const instanceA = got . extend ( { https : {
122
- rejectUnauthorized : true ,
123
- certificate : 'FIRST' ,
124
- } } ) ;
125
- const instanceB = got . extend ( { https : {
126
- certificate : 'SECOND' ,
127
- } } ) ;
125
+ const instanceA = got . extend ( {
126
+ https : {
127
+ rejectUnauthorized : true ,
128
+ certificate : 'FIRST' ,
129
+ } ,
130
+ } ) ;
131
+ const instanceB = got . extend ( {
132
+ https : {
133
+ certificate : 'SECOND' ,
134
+ } ,
135
+ } ) ;
128
136
129
137
const merged = instanceA . extend ( instanceB ) ;
130
138
@@ -133,13 +141,17 @@ test('merging instances with HTTPS options', t => {
133
141
} ) ;
134
142
135
143
test ( 'merging instances with HTTPS options undefined' , t => {
136
- const instanceA = got . extend ( { https : {
137
- rejectUnauthorized : true ,
138
- certificate : 'FIRST' ,
139
- } } ) ;
140
- const instanceB = got . extend ( { https : {
141
- certificate : undefined ,
142
- } } ) ;
144
+ const instanceA = got . extend ( {
145
+ https : {
146
+ rejectUnauthorized : true ,
147
+ certificate : 'FIRST' ,
148
+ } ,
149
+ } ) ;
150
+ const instanceB = got . extend ( {
151
+ https : {
152
+ certificate : undefined ,
153
+ } ,
154
+ } ) ;
143
155
144
156
const merged = instanceA . extend ( instanceB ) ;
145
157
0 commit comments