Created
March 24, 2020 13:56
-
-
Save chinesedfan/5833e4a7009f8449cf7d3cb3eac77680 to your computer and use it in GitHub Desktop.
Comparisons between different versions of axios merge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAIL test/specs/core/mergeConfig.spec.js | |
core::mergeConfig | |
✓ should accept undefined for second argument (4ms) | |
✓ should accept an object for second argument (1ms) | |
✕ should not leave references (3ms) | |
✓ should allow setting request options (1ms) | |
✕ should not inherit request options (1ms) | |
✓ should set new config forauth without default (1ms) | |
✓ should merge auth with defaults | |
✕ should overwrite default auth with a non-object value (3ms) | |
✓ should set new config forheaders without default (1ms) | |
✓ should merge headers with defaults | |
✕ should overwrite default headers with a non-object value (1ms) | |
✓ should set new config forparams without default | |
✓ should merge params with defaults | |
✕ should overwrite default params with a non-object value (1ms) | |
✓ should set new config forproxy without default | |
✓ should merge proxy with defaults (1ms) | |
✕ should overwrite default proxy with a non-object value | |
✓ should allow setting other options (1ms) | |
✓ should allow setting custom options | |
✓ should allow setting custom default options | |
✓ should allow merging custom objects in the config | |
valueFromConfig2Keys | |
✕ should skip if config2 is undefined (1ms) | |
✓ should clone config2 if is plain object | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
mergeDeepPropertiesKeys | |
✓ should skip if both config1 and config2 are undefined | |
✓ should merge if both config1 and config2 are plain object (1ms) | |
✕ should clone config2 if is plain object | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
✕ should clone config1 if is plain object | |
✕ should clone config1 if is array (1ms) | |
✓ should set as config1 in other cases | |
defaultToConfig2Keys | |
✓ should skip if both config1 and config2 are undefined | |
✕ should clone config2 if both config1 and config2 are plain object | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
✕ should clone config1 if is plain object | |
✕ should clone config1 if is array | |
✓ should set as config1 in other cases (1ms) | |
directMergeKeys | |
✓ should merge if config2 in keys | |
✓ should merge if both config1 and config2 are plain object | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases | |
✕ should clone config1 if is plain object (1ms) | |
✕ should clone config1 if is array | |
✓ should set as config1 in other cases (1ms) | |
● core::mergeConfig › should not leave references | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"common": {"Accept": "application/json, text/plain, */*"}, "delete": {}, "get": {}, "head": {}, "patch": {"Content-Type": "application/x-www-form-urlencoded"}, "post": {"Content-Type": "application/x-www-form-urlencoded"}, "put": {"Content-Type": "application/x-www-form-urlencoded"}} | |
15 | var merged = mergeConfig(defaults, {}); | |
16 | expect(merged).not.toBe(defaults); | |
> 17 | expect(merged.headers).not.toBe(defaults.headers); | |
| ^ | |
18 | }); | |
19 | | |
20 | it('should allow setting request options', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:17:32) | |
● core::mergeConfig › should not inherit request options | |
expect(received).toEqual(expected) // deep equality | |
Expected: undefined | |
Received: "__sample method__" | |
38 | }; | |
39 | var merged = mergeConfig(localDefaults, {}); | |
> 40 | expect(merged.method).toEqual(undefined); | |
| ^ | |
41 | expect(merged.data).toEqual(undefined); | |
42 | }); | |
43 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:40:27) | |
● core::mergeConfig › should overwrite default auth with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "auth": null, | |
+ "auth": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default headers with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "headers": null, | |
+ "headers": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default params with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "params": null, | |
+ "params": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default proxy with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "proxy": null, | |
+ "proxy": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › valueFromConfig2Keys › should skip if config2 is undefined | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "data": Object { | |
+ "a": 3, | |
+ }, | |
+ "method": "post", | |
+ "url": "/foo", | |
+ } | |
106 | | |
107 | it('should skip if config2 is undefined', function() { | |
> 108 | expect(mergeConfig(config1, {})).toEqual({}); | |
| ^ | |
109 | }); | |
110 | | |
111 | it('should clone config2 if is plain object', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:108:40) | |
● core::mergeConfig › valueFromConfig2Keys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 3} | |
119 | var data = [1, 2, 3]; | |
120 | var merged = mergeConfig(config1, {data: data}); | |
> 121 | expect(merged.data).toEqual(data); | |
| ^ | |
122 | expect(merged.data).not.toBe(data); | |
123 | }); | |
124 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:121:27) | |
● core::mergeConfig › valueFromConfig2Keys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 3, | |
+ } | |
127 | expect(mergeConfig(config1, {data: 1}).data).toBe(1); | |
128 | expect(mergeConfig(config1, {data: 'str'}).data).toBe('str'); | |
> 129 | expect(mergeConfig(config1, {data: obj}).data).toBe(obj); | |
| ^ | |
130 | expect(mergeConfig(config1, {data: null}).data).toBe(null); | |
131 | }); | |
132 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:129:54) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "0": 1, | |
+ "1": 2, | |
+ "2": 3, | |
"a": 1, | |
"b": 2, | |
} | |
146 | var config2 = {headers: {a: 1, b: 2}}; | |
147 | var merged = mergeConfig(config1, config2); | |
> 148 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
149 | expect(merged.headers).not.toBe(config2.headers); | |
150 | }); | |
151 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:148:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 1} | |
154 | var config2 = {headers: [1, 2, 3]}; | |
155 | var merged = mergeConfig(config1, config2); | |
> 156 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
157 | expect(merged.headers).not.toBe(config2.headers); | |
158 | }); | |
159 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:156:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 1, | |
+ } | |
163 | expect(mergeConfig(config1, {headers: 1}).headers).toBe(1); | |
164 | expect(mergeConfig(config1, {headers: 'str'}).headers).toBe('str'); | |
> 165 | expect(mergeConfig(config1, {headers: obj}).headers).toBe(obj); | |
| ^ | |
166 | expect(mergeConfig(config1, {headers: null}).headers).toBe(null); | |
167 | }); | |
168 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:165:60) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config1 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
172 | var merged = mergeConfig(config1, config2); | |
173 | expect(merged.headers).toEqual(config1.headers); | |
> 174 | expect(merged.headers).not.toBe(config1.headers); | |
| ^ | |
175 | }); | |
176 | | |
177 | it('should clone config1 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:174:34) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config1 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
180 | var merged = mergeConfig(config1, config2); | |
181 | expect(merged.headers).toEqual(config1.headers); | |
> 182 | expect(merged.headers).not.toBe(config1.headers); | |
| ^ | |
183 | }); | |
184 | | |
185 | it('should set as config1 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:182:34) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if both config1 and config2 are plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "a": 1, | |
"b": 2, | |
"c": 2, | |
} | |
202 | var config2 = {transformRequest: {b: 2, c: 2}}; | |
203 | var merged = mergeConfig(config1, config2); | |
> 204 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
| ^ | |
205 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
206 | }); | |
207 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:204:39) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 1} | |
210 | var config2 = {transformRequest: [1, 2, 3]}; | |
211 | var merged = mergeConfig(config1, config2); | |
> 212 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
| ^ | |
213 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
214 | }); | |
215 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:212:39) | |
● core::mergeConfig › defaultToConfig2Keys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 1, | |
+ } | |
219 | expect(mergeConfig(config1, {transformRequest: 1}).transformRequest).toBe(1); | |
220 | expect(mergeConfig(config1, {transformRequest: 'str'}).transformRequest).toBe('str'); | |
> 221 | expect(mergeConfig(config1, {transformRequest: obj}).transformRequest).toBe(obj); | |
| ^ | |
222 | expect(mergeConfig(config1, {transformRequest: null}).transformRequest).toBe(null); | |
223 | }); | |
224 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:221:78) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config1 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
228 | var merged = mergeConfig(config1, config2); | |
229 | expect(merged.transformRequest).toEqual(config1.transformRequest); | |
> 230 | expect(merged.transformRequest).not.toBe(config1.transformRequest); | |
| ^ | |
231 | }); | |
232 | | |
233 | it('should clone config1 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:230:43) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config1 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
236 | var merged = mergeConfig(config1, config2); | |
237 | expect(merged.transformRequest).toEqual(config1.transformRequest); | |
> 238 | expect(merged.transformRequest).not.toBe(config1.transformRequest); | |
| ^ | |
239 | }); | |
240 | | |
241 | it('should set as config1 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:238:43) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "0": 1, | |
+ "1": 2, | |
+ "2": 3, | |
"a": 1, | |
"b": 2, | |
} | |
263 | var config2 = {validateStatus: {a: 1, b: 2}}; | |
264 | var merged = mergeConfig(config1, config2); | |
> 265 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
| ^ | |
266 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
267 | }); | |
268 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:265:37) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 2} | |
271 | var config2 = {validateStatus: [1, 2, 3]}; | |
272 | var merged = mergeConfig(config1, config2); | |
> 273 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
| ^ | |
274 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
275 | }); | |
276 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:273:37) | |
● core::mergeConfig › directMergeKeys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 2, | |
+ } | |
280 | expect(mergeConfig(config1, {validateStatus: 1}).validateStatus).toBe(1); | |
281 | expect(mergeConfig(config1, {validateStatus: 'str'}).validateStatus).toBe('str'); | |
> 282 | expect(mergeConfig(config1, {validateStatus: obj}).validateStatus).toBe(obj); | |
| ^ | |
283 | expect(mergeConfig(config1, {validateStatus: null}).validateStatus).toBe(null); | |
284 | }); | |
285 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:282:74) | |
● core::mergeConfig › directMergeKeys › should clone config1 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
289 | var merged = mergeConfig(config1, config2); | |
290 | expect(merged.validateStatus).toEqual(config1.validateStatus); | |
> 291 | expect(merged.validateStatus).not.toBe(config1.validateStatus); | |
| ^ | |
292 | }); | |
293 | | |
294 | it('should clone config1 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:291:41) | |
● core::mergeConfig › directMergeKeys › should clone config1 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
297 | var merged = mergeConfig(config1, config2); | |
298 | expect(merged.validateStatus).toEqual(config1.validateStatus); | |
> 299 | expect(merged.validateStatus).not.toBe(config1.validateStatus); | |
| ^ | |
300 | }); | |
301 | | |
302 | it('should set as config1 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:299:41) | |
Test Suites: 1 failed, 1 total | |
Tests: 24 failed, 24 passed, 48 total | |
Snapshots: 0 total | |
Time: 1.529s | |
Ran all test suites matching /test\/specs\/core\/mergeConfig.spec.js/i. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAIL test/specs/core/mergeConfig.spec.js | |
core::mergeConfig | |
✕ should accept undefined for second argument (11ms) | |
✕ should accept an object for second argument (3ms) | |
✓ should not leave references | |
✓ should allow setting request options (1ms) | |
✕ should not inherit request options (1ms) | |
✓ should set new config forauth without default (1ms) | |
✓ should merge auth with defaults | |
✕ should overwrite default auth with a non-object value (2ms) | |
✓ should set new config forheaders without default | |
✓ should merge headers with defaults (1ms) | |
✕ should overwrite default headers with a non-object value (1ms) | |
✓ should set new config forparams without default | |
✓ should merge params with defaults | |
✕ should overwrite default params with a non-object value (1ms) | |
✓ should set new config forproxy without default | |
✓ should merge proxy with defaults | |
✕ should overwrite default proxy with a non-object value (1ms) | |
✓ should allow setting other options | |
✓ should allow setting custom options | |
✓ should allow setting custom default options (1ms) | |
✓ should allow merging custom objects in the config | |
valueFromConfig2Keys | |
✕ should skip if config2 is undefined | |
✓ should clone config2 if is plain object (5ms) | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
mergeDeepPropertiesKeys | |
✓ should skip if both config1 and config2 are undefined (1ms) | |
✓ should merge if both config1 and config2 are plain object | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
✓ should clone config1 if is plain object | |
✕ should clone config1 if is array (1ms) | |
✕ should set as config1 in other cases (2ms) | |
defaultToConfig2Keys | |
✓ should skip if both config1 and config2 are undefined | |
✕ should clone config2 if both config1 and config2 are plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
✓ should clone config1 if is plain object (1ms) | |
✕ should clone config1 if is array (1ms) | |
✕ should set as config1 in other cases | |
directMergeKeys | |
✓ should merge if config2 in keys (1ms) | |
✓ should merge if both config1 and config2 are plain object | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array | |
✕ should set as config2 in other cases (2ms) | |
✓ should clone config1 if is plain object | |
✕ should clone config1 if is array (1ms) | |
✕ should set as config1 in other cases | |
● core::mergeConfig › should accept undefined for second argument | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
@@ -18,15 +18,15 @@ | |
}, | |
}, | |
"maxBodyLength": -1, | |
"maxContentLength": -1, | |
"timeout": 0, | |
- "transformRequest": Array [ | |
- [Function transformRequest], | |
- ], | |
- "transformResponse": Array [ | |
- [Function transformResponse], | |
- ], | |
+ "transformRequest": Object { | |
+ "0": [Function transformRequest], | |
+ }, | |
+ "transformResponse": Object { | |
+ "0": [Function transformResponse], | |
+ }, | |
"validateStatus": [Function validateStatus], | |
"xsrfCookieName": "XSRF-TOKEN", | |
"xsrfHeaderName": "X-XSRF-TOKEN", | |
} | |
5 | describe('core::mergeConfig', function() { | |
6 | it('should accept undefined for second argument', function() { | |
> 7 | expect(mergeConfig(defaults, undefined)).toEqual(defaults); | |
| ^ | |
8 | }); | |
9 | | |
10 | it('should accept an object for second argument', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:7:46) | |
● core::mergeConfig › should accept an object for second argument | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
@@ -18,15 +18,15 @@ | |
}, | |
}, | |
"maxBodyLength": -1, | |
"maxContentLength": -1, | |
"timeout": 0, | |
- "transformRequest": Array [ | |
- [Function transformRequest], | |
- ], | |
- "transformResponse": Array [ | |
- [Function transformResponse], | |
- ], | |
+ "transformRequest": Object { | |
+ "0": [Function transformRequest], | |
+ }, | |
+ "transformResponse": Object { | |
+ "0": [Function transformResponse], | |
+ }, | |
"validateStatus": [Function validateStatus], | |
"xsrfCookieName": "XSRF-TOKEN", | |
"xsrfHeaderName": "X-XSRF-TOKEN", | |
} | |
9 | | |
10 | it('should accept an object for second argument', function() { | |
> 11 | expect(mergeConfig(defaults, {})).toEqual(defaults); | |
| ^ | |
12 | }); | |
13 | | |
14 | it('should not leave references', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:11:39) | |
● core::mergeConfig › should not inherit request options | |
expect(received).toEqual(expected) // deep equality | |
Expected: undefined | |
Received: "__sample method__" | |
38 | }; | |
39 | var merged = mergeConfig(localDefaults, {}); | |
> 40 | expect(merged.method).toEqual(undefined); | |
| ^ | |
41 | expect(merged.data).toEqual(undefined); | |
42 | }); | |
43 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:40:27) | |
● core::mergeConfig › should overwrite default auth with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "auth": null, | |
+ "auth": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default headers with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "headers": null, | |
+ "headers": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default params with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "params": null, | |
+ "params": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › should overwrite default proxy with a non-object value | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
- "proxy": null, | |
+ "proxy": Object { | |
+ "pass": "test", | |
+ "user": "foo", | |
+ }, | |
} | |
68 | c[key] = value; | |
69 | | |
> 70 | expect(mergeConfig(a, b)).toEqual(c); | |
| ^ | |
71 | }); | |
72 | }); | |
73 | }); | |
at toEqual (test/specs/core/mergeConfig.spec.js:70:35) | |
at Array.forEach (<anonymous>) | |
at Object.forEach (test/specs/core/mergeConfig.spec.js:64:26) | |
● core::mergeConfig › valueFromConfig2Keys › should skip if config2 is undefined | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "data": Object { | |
+ "a": 3, | |
+ }, | |
+ "method": "post", | |
+ "url": "/foo", | |
+ } | |
106 | | |
107 | it('should skip if config2 is undefined', function() { | |
> 108 | expect(mergeConfig(config1, {})).toEqual({}); | |
| ^ | |
109 | }); | |
110 | | |
111 | it('should clone config2 if is plain object', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:108:40) | |
● core::mergeConfig › valueFromConfig2Keys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 3} | |
119 | var data = [1, 2, 3]; | |
120 | var merged = mergeConfig(config1, {data: data}); | |
> 121 | expect(merged.data).toEqual(data); | |
| ^ | |
122 | expect(merged.data).not.toBe(data); | |
123 | }); | |
124 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:121:27) | |
● core::mergeConfig › valueFromConfig2Keys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 3, | |
+ } | |
127 | expect(mergeConfig(config1, {data: 1}).data).toBe(1); | |
128 | expect(mergeConfig(config1, {data: 'str'}).data).toBe('str'); | |
> 129 | expect(mergeConfig(config1, {data: obj}).data).toBe(obj); | |
| ^ | |
130 | expect(mergeConfig(config1, {data: null}).data).toBe(null); | |
131 | }); | |
132 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:129:54) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "0": 1, | |
+ "1": 2, | |
+ "2": 3, | |
"a": 1, | |
"b": 2, | |
} | |
146 | var config2 = {headers: {a: 1, b: 2}}; | |
147 | var merged = mergeConfig(config1, config2); | |
> 148 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
149 | expect(merged.headers).not.toBe(config2.headers); | |
150 | }); | |
151 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:148:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 1} | |
154 | var config2 = {headers: [1, 2, 3]}; | |
155 | var merged = mergeConfig(config1, config2); | |
> 156 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
157 | expect(merged.headers).not.toBe(config2.headers); | |
158 | }); | |
159 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:156:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 1, | |
+ } | |
163 | expect(mergeConfig(config1, {headers: 1}).headers).toBe(1); | |
164 | expect(mergeConfig(config1, {headers: 'str'}).headers).toBe('str'); | |
> 165 | expect(mergeConfig(config1, {headers: obj}).headers).toBe(obj); | |
| ^ | |
166 | expect(mergeConfig(config1, {headers: null}).headers).toBe(null); | |
167 | }); | |
168 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:165:60) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config1 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3} | |
179 | var config2 = {}; | |
180 | var merged = mergeConfig(config1, config2); | |
> 181 | expect(merged.headers).toEqual(config1.headers); | |
| ^ | |
182 | expect(merged.headers).not.toBe(config1.headers); | |
183 | }); | |
184 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:181:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should set as config1 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
If it should pass with deep equality, replace "toBe" with "toStrictEqual" | |
Expected: {} | |
Received: serializes to the same string | |
188 | expect(mergeConfig({headers: 1}, config2).headers).toBe(1); | |
189 | expect(mergeConfig({headers: 'str'}, config2).headers).toBe('str'); | |
> 190 | expect(mergeConfig({headers: obj}, config2).headers).toBe(obj); | |
| ^ | |
191 | expect(mergeConfig({headers: null}, config2).headers).toBe(null); | |
192 | }); | |
193 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:190:60) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if both config1 and config2 are plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "a": 1, | |
"b": 2, | |
"c": 2, | |
} | |
202 | var config2 = {transformRequest: {b: 2, c: 2}}; | |
203 | var merged = mergeConfig(config1, config2); | |
> 204 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
| ^ | |
205 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
206 | }); | |
207 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:204:39) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 1} | |
210 | var config2 = {transformRequest: [1, 2, 3]}; | |
211 | var merged = mergeConfig(config1, config2); | |
> 212 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
| ^ | |
213 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
214 | }); | |
215 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:212:39) | |
● core::mergeConfig › defaultToConfig2Keys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 1, | |
+ } | |
219 | expect(mergeConfig(config1, {transformRequest: 1}).transformRequest).toBe(1); | |
220 | expect(mergeConfig(config1, {transformRequest: 'str'}).transformRequest).toBe('str'); | |
> 221 | expect(mergeConfig(config1, {transformRequest: obj}).transformRequest).toBe(obj); | |
| ^ | |
222 | expect(mergeConfig(config1, {transformRequest: null}).transformRequest).toBe(null); | |
223 | }); | |
224 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:221:78) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config1 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3} | |
235 | var config2 = {}; | |
236 | var merged = mergeConfig(config1, config2); | |
> 237 | expect(merged.transformRequest).toEqual(config1.transformRequest); | |
| ^ | |
238 | expect(merged.transformRequest).not.toBe(config1.transformRequest); | |
239 | }); | |
240 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:237:39) | |
● core::mergeConfig › defaultToConfig2Keys › should set as config1 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
If it should pass with deep equality, replace "toBe" with "toStrictEqual" | |
Expected: {} | |
Received: serializes to the same string | |
244 | expect(mergeConfig({transformRequest: 1}, config2).transformRequest).toBe(1); | |
245 | expect(mergeConfig({transformRequest: 'str'}, config2).transformRequest).toBe('str'); | |
> 246 | expect(mergeConfig({transformRequest: obj}, config2).transformRequest).toBe(obj); | |
| ^ | |
247 | expect(mergeConfig({transformRequest: null}, config2).transformRequest).toBe(null); | |
248 | }); | |
249 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:246:78) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "0": 1, | |
+ "1": 2, | |
+ "2": 3, | |
"a": 1, | |
"b": 2, | |
} | |
263 | var config2 = {validateStatus: {a: 1, b: 2}}; | |
264 | var merged = mergeConfig(config1, config2); | |
> 265 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
| ^ | |
266 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
267 | }); | |
268 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:265:37) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 2} | |
271 | var config2 = {validateStatus: [1, 2, 3]}; | |
272 | var merged = mergeConfig(config1, config2); | |
> 273 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
| ^ | |
274 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
275 | }); | |
276 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:273:37) | |
● core::mergeConfig › directMergeKeys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 2, | |
+ } | |
280 | expect(mergeConfig(config1, {validateStatus: 1}).validateStatus).toBe(1); | |
281 | expect(mergeConfig(config1, {validateStatus: 'str'}).validateStatus).toBe('str'); | |
> 282 | expect(mergeConfig(config1, {validateStatus: obj}).validateStatus).toBe(obj); | |
| ^ | |
283 | expect(mergeConfig(config1, {validateStatus: null}).validateStatus).toBe(null); | |
284 | }); | |
285 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:282:74) | |
● core::mergeConfig › directMergeKeys › should clone config1 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3} | |
296 | var config2 = {}; | |
297 | var merged = mergeConfig(config1, config2); | |
> 298 | expect(merged.validateStatus).toEqual(config1.validateStatus); | |
| ^ | |
299 | expect(merged.validateStatus).not.toBe(config1.validateStatus); | |
300 | }); | |
301 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:298:37) | |
● core::mergeConfig › directMergeKeys › should set as config1 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
If it should pass with deep equality, replace "toBe" with "toStrictEqual" | |
Expected: {} | |
Received: serializes to the same string | |
305 | expect(mergeConfig({validateStatus: 1}, config2).validateStatus).toBe(1); | |
306 | expect(mergeConfig({validateStatus: 'str'}, config2).validateStatus).toBe('str'); | |
> 307 | expect(mergeConfig({validateStatus: obj}, config2).validateStatus).toBe(obj); | |
| ^ | |
308 | expect(mergeConfig({validateStatus: null}, config2).validateStatus).toBe(null); | |
309 | }); | |
310 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:307:74) | |
Test Suites: 1 failed, 1 total | |
Tests: 25 failed, 23 passed, 48 total | |
Snapshots: 0 total | |
Time: 1.85s | |
Ran all test suites matching /test\/specs\/core\/mergeConfig.spec.js/i. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FAIL test/specs/core/mergeConfig.spec.js | |
core::mergeConfig | |
✓ should accept undefined for second argument (5ms) | |
✓ should accept an object for second argument | |
✓ should not leave references | |
✓ should allow setting request options (2ms) | |
✓ should not inherit request options | |
✓ should set new config forauth without default (1ms) | |
✓ should merge auth with defaults | |
✓ should overwrite default auth with a non-object value (1ms) | |
✓ should set new config forheaders without default | |
✓ should merge headers with defaults | |
✓ should overwrite default headers with a non-object value (1ms) | |
✓ should set new config forparams without default (1ms) | |
✓ should merge params with defaults | |
✓ should overwrite default params with a non-object value (1ms) | |
✓ should set new config forproxy without default | |
✓ should merge proxy with defaults | |
✓ should overwrite default proxy with a non-object value (1ms) | |
✓ should allow setting other options (1ms) | |
✓ should allow setting custom options | |
✕ should allow setting custom default options (3ms) | |
✕ should allow merging custom objects in the config (1ms) | |
valueFromConfig2Keys | |
✕ should skip if config2 is undefined (3ms) | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✓ should set as config2 in other cases (1ms) | |
mergeDeepPropertiesKeys | |
✓ should skip if both config1 and config2 are undefined (1ms) | |
✓ should merge if both config1 and config2 are plain object | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✕ should set as config2 in other cases (1ms) | |
✓ should clone config1 if is plain object (1ms) | |
✕ should clone config1 if is array (1ms) | |
✕ should set as config1 in other cases (10ms) | |
defaultToConfig2Keys | |
✓ should skip if both config1 and config2 are undefined | |
✕ should clone config2 if both config1 and config2 are plain object (1ms) | |
✕ should clone config2 if is array (1ms) | |
✓ should set as config2 in other cases | |
✕ should clone config1 if is plain object (1ms) | |
✕ should clone config1 if is array | |
✓ should set as config1 in other cases (1ms) | |
directMergeKeys | |
✓ should merge if config2 in keys | |
✕ should merge if both config1 and config2 are plain object (1ms) | |
✕ should clone config2 if is plain object (1ms) | |
✕ should clone config2 if is array | |
✓ should set as config2 in other cases (1ms) | |
✕ should clone config1 if is plain object (1ms) | |
✕ should clone config1 if is array | |
✓ should set as config1 in other cases (1ms) | |
● core::mergeConfig › should allow setting custom default options | |
expect(received).toEqual(expected) // deep equality | |
Expected: "bar" | |
Received: undefined | |
85 | it('should allow setting custom default options', function() { | |
86 | var merged = mergeConfig({ foo: 'bar' }, {}); | |
> 87 | expect(merged.foo).toEqual('bar'); | |
| ^ | |
88 | }); | |
89 | | |
90 | it('should allow merging custom objects in the config', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:87:24) | |
● core::mergeConfig › should allow merging custom objects in the config | |
expect(received).toEqual(expected) // deep equality | |
Expected: true | |
Received: undefined | |
98 | } | |
99 | }); | |
> 100 | expect(merged.nestedConfig.propertyOnDefaultConfig).toEqual(true); | |
| ^ | |
101 | expect(merged.nestedConfig.propertyOnRequestConfig).toEqual(true); | |
102 | }); | |
103 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:100:57) | |
● core::mergeConfig › valueFromConfig2Keys › should skip if config2 is undefined | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "url": "/foo", | |
+ } | |
106 | | |
107 | it('should skip if config2 is undefined', function() { | |
> 108 | expect(mergeConfig(config1, {})).toEqual({}); | |
| ^ | |
109 | }); | |
110 | | |
111 | it('should clone config2 if is plain object', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:108:40) | |
● core::mergeConfig › valueFromConfig2Keys › should clone config2 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
113 | var merged = mergeConfig(config1, {data: data}); | |
114 | expect(merged.data).toEqual(data); | |
> 115 | expect(merged.data).not.toBe(data); | |
| ^ | |
116 | }); | |
117 | | |
118 | it('should clone config2 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:115:31) | |
● core::mergeConfig › valueFromConfig2Keys › should clone config2 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
120 | var merged = mergeConfig(config1, {data: data}); | |
121 | expect(merged.data).toEqual(data); | |
> 122 | expect(merged.data).not.toBe(data); | |
| ^ | |
123 | }); | |
124 | | |
125 | it('should set as config2 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:122:31) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
+ "0": 1, | |
+ "1": 2, | |
+ "2": 3, | |
"a": 1, | |
"b": 2, | |
} | |
146 | var config2 = {headers: {a: 1, b: 2}}; | |
147 | var merged = mergeConfig(config1, config2); | |
> 148 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
149 | expect(merged.headers).not.toBe(config2.headers); | |
150 | }); | |
151 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:148:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config2 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3, "a": 1, "b": 1} | |
154 | var config2 = {headers: [1, 2, 3]}; | |
155 | var merged = mergeConfig(config1, config2); | |
> 156 | expect(merged.headers).toEqual(config2.headers); | |
| ^ | |
157 | expect(merged.headers).not.toBe(config2.headers); | |
158 | }); | |
159 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:156:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should set as config2 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
- Expected | |
+ Received | |
- Object {} | |
+ Object { | |
+ "a": 1, | |
+ "b": 1, | |
+ } | |
163 | expect(mergeConfig(config1, {headers: 1}).headers).toBe(1); | |
164 | expect(mergeConfig(config1, {headers: 'str'}).headers).toBe('str'); | |
> 165 | expect(mergeConfig(config1, {headers: obj}).headers).toBe(obj); | |
| ^ | |
166 | expect(mergeConfig(config1, {headers: null}).headers).toBe(null); | |
167 | }); | |
168 | | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:165:60) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should clone config1 if is array | |
expect(received).toEqual(expected) // deep equality | |
Expected: [1, 2, 3] | |
Received: {"0": 1, "1": 2, "2": 3} | |
179 | var config2 = {}; | |
180 | var merged = mergeConfig(config1, config2); | |
> 181 | expect(merged.headers).toEqual(config1.headers); | |
| ^ | |
182 | expect(merged.headers).not.toBe(config1.headers); | |
183 | }); | |
184 | | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:181:30) | |
● core::mergeConfig › mergeDeepPropertiesKeys › should set as config1 in other cases | |
expect(received).toBe(expected) // Object.is equality | |
If it should pass with deep equality, replace "toBe" with "toStrictEqual" | |
Expected: {} | |
Received: serializes to the same string | |
188 | expect(mergeConfig({headers: 1}, config2).headers).toBe(1); | |
189 | expect(mergeConfig({headers: 'str'}, config2).headers).toBe('str'); | |
> 190 | expect(mergeConfig({headers: obj}, config2).headers).toBe(obj); | |
| ^ | |
191 | expect(mergeConfig({headers: null}, config2).headers).toBe(null); | |
192 | }); | |
193 | }); | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:190:60) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if both config1 and config2 are plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"b": 2, "c": 2} | |
203 | var merged = mergeConfig(config1, config2); | |
204 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
> 205 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
| ^ | |
206 | }); | |
207 | | |
208 | it('should clone config2 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:205:43) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config2 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
211 | var merged = mergeConfig(config1, config2); | |
212 | expect(merged.transformRequest).toEqual(config2.transformRequest); | |
> 213 | expect(merged.transformRequest).not.toBe(config2.transformRequest); | |
| ^ | |
214 | }); | |
215 | | |
216 | it('should set as config2 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:213:43) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config1 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
228 | var merged = mergeConfig(config1, config2); | |
229 | expect(merged.transformRequest).toEqual(config1.transformRequest); | |
> 230 | expect(merged.transformRequest).not.toBe(config1.transformRequest); | |
| ^ | |
231 | }); | |
232 | | |
233 | it('should clone config1 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:230:43) | |
● core::mergeConfig › defaultToConfig2Keys › should clone config1 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
236 | var merged = mergeConfig(config1, config2); | |
237 | expect(merged.transformRequest).toEqual(config1.transformRequest); | |
> 238 | expect(merged.transformRequest).not.toBe(config1.transformRequest); | |
| ^ | |
239 | }); | |
240 | | |
241 | it('should set as config1 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:238:43) | |
● core::mergeConfig › directMergeKeys › should merge if both config1 and config2 are plain object | |
expect(received).toEqual(expected) // deep equality | |
- Expected | |
+ Received | |
Object { | |
"validateStatus": Object { | |
- "a": 1, | |
"b": 2, | |
"c": 2, | |
}, | |
} | |
256 | it('should merge if both config1 and config2 are plain object', function() { | |
257 | expect(mergeConfig({validateStatus: {a: 1, b: 1}}, {validateStatus: {b: 2, c: 2}})) | |
> 258 | .toEqual({validateStatus: {a: 1, b: 2, c: 2}}); | |
| ^ | |
259 | }); | |
260 | | |
261 | it('should clone config2 if is plain object', function() { | |
at Object.toEqual (test/specs/core/mergeConfig.spec.js:258:10) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
264 | var merged = mergeConfig(config1, config2); | |
265 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
> 266 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
| ^ | |
267 | }); | |
268 | | |
269 | it('should clone config2 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:266:41) | |
● core::mergeConfig › directMergeKeys › should clone config2 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
272 | var merged = mergeConfig(config1, config2); | |
273 | expect(merged.validateStatus).toEqual(config2.validateStatus); | |
> 274 | expect(merged.validateStatus).not.toBe(config2.validateStatus); | |
| ^ | |
275 | }); | |
276 | | |
277 | it('should set as config2 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:274:41) | |
● core::mergeConfig › directMergeKeys › should clone config1 if is plain object | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not {"a": 1, "b": 2} | |
289 | var merged = mergeConfig(config1, config2); | |
290 | expect(merged.validateStatus).toEqual(config1.validateStatus); | |
> 291 | expect(merged.validateStatus).not.toBe(config1.validateStatus); | |
| ^ | |
292 | }); | |
293 | | |
294 | it('should clone config1 if is array', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:291:41) | |
● core::mergeConfig › directMergeKeys › should clone config1 if is array | |
expect(received).not.toBe(expected) // Object.is equality | |
Expected: not [1, 2, 3] | |
297 | var merged = mergeConfig(config1, config2); | |
298 | expect(merged.validateStatus).toEqual(config1.validateStatus); | |
> 299 | expect(merged.validateStatus).not.toBe(config1.validateStatus); | |
| ^ | |
300 | }); | |
301 | | |
302 | it('should set as config1 in other cases', function() { | |
at Object.toBe (test/specs/core/mergeConfig.spec.js:299:41) | |
Test Suites: 1 failed, 1 total | |
Tests: 19 failed, 29 passed, 48 total | |
Snapshots: 0 total | |
Time: 2.12s | |
Ran all test suites matching /test\/specs\/core\/mergeConfig.spec.js/i. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment