MCPcopy Index your code
hub / github.com/ccxt/ccxt / testDeepExtend

Function testDeepExtend

js/src/test/base/test.deepExtend.js:3–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import ccxt from '../../../ccxt.js';
2import testSharedMethods from '../Exchange/base/test.sharedMethods.js';
3function testDeepExtend() {
4 const exchange = new ccxt.Exchange({
5 'id': 'sampleexchange',
6 });
7 const obj1 = {
8 "a": 1,
9 "b": [1, 2, 3],
10 "c": [{ "test1": 1, "test2": 1 }],
11 "d": undefined,
12 "e": "not_undefined",
13 "sub": {
14 "a": 1,
15 "b": [1, 2],
16 "c": [{ "test1": 1, "test2": 2 }],
17 "d": undefined,
18 "e": "not_undefined",
19 "other1": "x",
20 },
21 "other1": "x",
22 };
23 const obj2 = {
24 "a": 2,
25 "b": [3, 4],
26 "c": [{ "test1": 2, "test3": 3 }],
27 "d": "not_undefined",
28 "e": undefined,
29 "sub": {
30 "a": 2,
31 "b": [3, 4],
32 "c": [{ "test1": 2, "test3": 3 }],
33 "d": "not_undefined",
34 "e": undefined,
35 "other2": "y",
36 },
37 "other2": "y",
38 };
39 // deepExtend
40 const deepExtended = exchange.deepExtend(obj1, obj2);
41 const compareTo = {
42 "a": 2,
43 "b": [3, 4],
44 "c": [{
45 "test1": 2,
46 "test3": 3,
47 }],
48 "d": "not_undefined",
49 "e": undefined,
50 "sub": {
51 "a": 2,
52 "b": [3, 4],
53 "c": [{ "test1": 2, "test3": 3 }],
54 "d": "not_undefined",
55 "e": undefined,
56 "other1": "x",
57 "other2": "y",
58 },
59 "other1": "x",
60 "other2": "y",

Callers 1

baseTestsInitFunction · 0.70

Calls 1

deepExtendMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…