@portal-hq/web 3.6.2-alpha → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hypernative.d.ts +346 -0
- package/lib/commonjs/index.js +144 -2
- package/lib/commonjs/index.test.js +119 -2
- package/lib/commonjs/integrations/security/hypernative/index.js +101 -0
- package/lib/commonjs/integrations/security/hypernative/index.test.js +151 -0
- package/lib/commonjs/integrations/security/index.js +16 -0
- package/lib/commonjs/integrations/trading/zero-x/index.js +17 -4
- package/lib/commonjs/integrations/trading/zero-x/index.test.js +61 -15
- package/lib/commonjs/mpc/index.js +156 -5
- package/lib/commonjs/mpc/index.test.js +794 -5
- package/lib/commonjs/passkeys/index.js +394 -0
- package/lib/commonjs/passkeys/types.js +2 -0
- package/lib/commonjs/provider/index.js +5 -2
- package/lib/esm/index.js +144 -2
- package/lib/esm/index.test.js +119 -2
- package/lib/esm/integrations/security/hypernative/index.js +98 -0
- package/lib/esm/integrations/security/hypernative/index.test.js +146 -0
- package/lib/esm/integrations/security/index.js +10 -0
- package/lib/esm/integrations/trading/zero-x/index.js +17 -4
- package/lib/esm/integrations/trading/zero-x/index.test.js +62 -16
- package/lib/esm/mpc/index.js +156 -5
- package/lib/esm/mpc/index.test.js +795 -6
- package/lib/esm/passkeys/index.js +390 -0
- package/lib/esm/passkeys/types.js +1 -0
- package/lib/esm/provider/index.js +5 -2
- package/lifi-types.d.ts +1236 -0
- package/package.json +6 -3
- package/src/__mocks/constants.ts +422 -5
- package/src/__mocks/portal/mpc.ts +1 -0
- package/src/index.test.ts +179 -3
- package/src/index.ts +212 -4
- package/src/integrations/security/hypernative/index.test.ts +196 -0
- package/src/integrations/security/hypernative/index.ts +106 -0
- package/src/integrations/security/index.ts +14 -0
- package/src/integrations/trading/zero-x/index.test.ts +98 -19
- package/src/integrations/trading/zero-x/index.ts +29 -9
- package/src/mpc/index.test.ts +944 -7
- package/src/mpc/index.ts +200 -10
- package/src/passkeys/index.ts +536 -0
- package/src/passkeys/types.ts +78 -0
- package/src/provider/index.ts +5 -0
- package/tsconfig.json +7 -1
- package/types.d.ts +45 -12
- package/yieldxyz-types.d.ts +778 -0
- package/zero-x.d.ts +204 -0
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @jest-environment jsdom
|
|
4
4
|
*/
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
5
14
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
15
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
16
|
};
|
|
@@ -101,6 +110,49 @@ describe('Mpc', () => {
|
|
|
101
110
|
done();
|
|
102
111
|
});
|
|
103
112
|
});
|
|
113
|
+
it('should include encryption key when iframe returns custom backup response', (done) => {
|
|
114
|
+
var _a;
|
|
115
|
+
const setBackupStatusSpy = jest
|
|
116
|
+
.spyOn(mpc, 'setBackupStatus')
|
|
117
|
+
.mockResolvedValue(true);
|
|
118
|
+
jest
|
|
119
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
120
|
+
.mockImplementation((message, origin) => {
|
|
121
|
+
const { type, data } = message;
|
|
122
|
+
expect(type).toEqual('portal:wasm:backup');
|
|
123
|
+
expect(data).toEqual(args);
|
|
124
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
125
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
126
|
+
origin: mockHostOrigin,
|
|
127
|
+
data: {
|
|
128
|
+
type: 'portal:wasm:backupResult',
|
|
129
|
+
data: {
|
|
130
|
+
cipherText: constants_1.mockCipherText,
|
|
131
|
+
encryptionKey: 'custom-backup-key',
|
|
132
|
+
backupIds: constants_1.mockBackupIds,
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
137
|
+
mpc
|
|
138
|
+
.backup(args)
|
|
139
|
+
.then((res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
140
|
+
expect(res.cipherText).toEqual(constants_1.mockCipherText);
|
|
141
|
+
expect(res.encryptionKey).toEqual('custom-backup-key');
|
|
142
|
+
yield res.storageCallback();
|
|
143
|
+
expect(setBackupStatusSpy).toHaveBeenCalledTimes(1);
|
|
144
|
+
expect(setBackupStatusSpy).toHaveBeenCalledWith('STORED_CLIENT_BACKUP_SHARE', constants_1.mockBackupIds);
|
|
145
|
+
done();
|
|
146
|
+
}))
|
|
147
|
+
.catch((e) => {
|
|
148
|
+
console.error(e);
|
|
149
|
+
expect(0).toEqual(1);
|
|
150
|
+
done();
|
|
151
|
+
})
|
|
152
|
+
.finally(() => {
|
|
153
|
+
setBackupStatusSpy.mockRestore();
|
|
154
|
+
});
|
|
155
|
+
});
|
|
104
156
|
it('should error out if the iframe sends an error message', (done) => {
|
|
105
157
|
var _a;
|
|
106
158
|
jest
|
|
@@ -212,7 +264,7 @@ describe('Mpc', () => {
|
|
|
212
264
|
})
|
|
213
265
|
.catch((e) => {
|
|
214
266
|
expect(e).toBeInstanceOf(Error);
|
|
215
|
-
expect(e.message).toEqual('Invalid backup method: INVALID_METHOD. Valid methods are: GDRIVE, PASSWORD, PASSKEY, UNKNOWN');
|
|
267
|
+
expect(e.message).toEqual('Invalid backup method: INVALID_METHOD. Valid methods are: GDRIVE, PASSWORD, PASSKEY, CUSTOM, UNKNOWN');
|
|
216
268
|
done();
|
|
217
269
|
});
|
|
218
270
|
});
|
|
@@ -1251,7 +1303,7 @@ describe('Mpc', () => {
|
|
|
1251
1303
|
}));
|
|
1252
1304
|
});
|
|
1253
1305
|
mpc
|
|
1254
|
-
.getQuote(
|
|
1306
|
+
.getQuote('eip155:1', constants_1.mockQuoteArgs, constants_1.mockApikey)
|
|
1255
1307
|
.then((data) => {
|
|
1256
1308
|
expect(data).toEqual(res);
|
|
1257
1309
|
done();
|
|
@@ -1286,7 +1338,7 @@ describe('Mpc', () => {
|
|
|
1286
1338
|
}));
|
|
1287
1339
|
});
|
|
1288
1340
|
mpc
|
|
1289
|
-
.getQuote(
|
|
1341
|
+
.getQuote('eip155:1', constants_1.mockQuoteArgs, constants_1.mockApikey)
|
|
1290
1342
|
.then(() => {
|
|
1291
1343
|
expect(0).toEqual(1);
|
|
1292
1344
|
done();
|
|
@@ -1319,7 +1371,7 @@ describe('Mpc', () => {
|
|
|
1319
1371
|
}));
|
|
1320
1372
|
});
|
|
1321
1373
|
mpc
|
|
1322
|
-
.getSources(
|
|
1374
|
+
.getSources('eip155:1', constants_1.mockApikey)
|
|
1323
1375
|
.then((data) => {
|
|
1324
1376
|
expect(data).toEqual(res);
|
|
1325
1377
|
done();
|
|
@@ -1350,7 +1402,7 @@ describe('Mpc', () => {
|
|
|
1350
1402
|
}));
|
|
1351
1403
|
});
|
|
1352
1404
|
mpc
|
|
1353
|
-
.getSources(
|
|
1405
|
+
.getSources('eip155:1', constants_1.mockApikey)
|
|
1354
1406
|
.then(() => {
|
|
1355
1407
|
expect(0).toEqual(1);
|
|
1356
1408
|
done();
|
|
@@ -2498,4 +2550,741 @@ describe('Mpc', () => {
|
|
|
2498
2550
|
});
|
|
2499
2551
|
});
|
|
2500
2552
|
});
|
|
2553
|
+
describe('getSwapsQuoteV2', () => {
|
|
2554
|
+
const args = constants_1.mockZeroExQuoteV2Request;
|
|
2555
|
+
const options = constants_1.mockZeroExOptions;
|
|
2556
|
+
const res = constants_1.mockZeroExQuoteV2Response;
|
|
2557
|
+
it('should successfully return the quote', (done) => {
|
|
2558
|
+
var _a;
|
|
2559
|
+
jest
|
|
2560
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2561
|
+
.mockImplementation((message, origin) => {
|
|
2562
|
+
const { type, data } = message;
|
|
2563
|
+
expect(type).toEqual('portal:swaps:getQuoteV2');
|
|
2564
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2565
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2566
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2567
|
+
origin: mockHostOrigin,
|
|
2568
|
+
data: {
|
|
2569
|
+
type: 'portal:swaps:getQuoteV2Result',
|
|
2570
|
+
data: res,
|
|
2571
|
+
},
|
|
2572
|
+
}));
|
|
2573
|
+
});
|
|
2574
|
+
mpc
|
|
2575
|
+
.getSwapsQuoteV2(args, options)
|
|
2576
|
+
.then((data) => {
|
|
2577
|
+
expect(data).toEqual(res);
|
|
2578
|
+
done();
|
|
2579
|
+
})
|
|
2580
|
+
.catch((_) => {
|
|
2581
|
+
expect(0).toEqual(1);
|
|
2582
|
+
done();
|
|
2583
|
+
});
|
|
2584
|
+
});
|
|
2585
|
+
it('should successfully return the quote without options', (done) => {
|
|
2586
|
+
var _a;
|
|
2587
|
+
jest
|
|
2588
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2589
|
+
.mockImplementation((message, origin) => {
|
|
2590
|
+
const { type, data } = message;
|
|
2591
|
+
expect(type).toEqual('portal:swaps:getQuoteV2');
|
|
2592
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options: undefined }));
|
|
2593
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2594
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2595
|
+
origin: mockHostOrigin,
|
|
2596
|
+
data: {
|
|
2597
|
+
type: 'portal:swaps:getQuoteV2Result',
|
|
2598
|
+
data: res,
|
|
2599
|
+
},
|
|
2600
|
+
}));
|
|
2601
|
+
});
|
|
2602
|
+
mpc
|
|
2603
|
+
.getSwapsQuoteV2(args)
|
|
2604
|
+
.then((data) => {
|
|
2605
|
+
expect(data).toEqual(res);
|
|
2606
|
+
done();
|
|
2607
|
+
})
|
|
2608
|
+
.catch((_) => {
|
|
2609
|
+
expect(0).toEqual(1);
|
|
2610
|
+
done();
|
|
2611
|
+
});
|
|
2612
|
+
});
|
|
2613
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2614
|
+
var _a;
|
|
2615
|
+
jest
|
|
2616
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2617
|
+
.mockImplementationOnce((message, origin) => {
|
|
2618
|
+
const { type, data } = message;
|
|
2619
|
+
expect(type).toEqual('portal:swaps:getQuoteV2');
|
|
2620
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2621
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2622
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2623
|
+
origin: mockHostOrigin,
|
|
2624
|
+
data: {
|
|
2625
|
+
type: 'portal:swaps:getQuoteV2Error',
|
|
2626
|
+
data: {
|
|
2627
|
+
code: 1,
|
|
2628
|
+
message: 'test',
|
|
2629
|
+
},
|
|
2630
|
+
},
|
|
2631
|
+
}));
|
|
2632
|
+
});
|
|
2633
|
+
mpc
|
|
2634
|
+
.getSwapsQuoteV2(args, options)
|
|
2635
|
+
.then(() => {
|
|
2636
|
+
expect(0).toEqual(1);
|
|
2637
|
+
done();
|
|
2638
|
+
})
|
|
2639
|
+
.catch((e) => {
|
|
2640
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
2641
|
+
expect(e.message).toEqual('test');
|
|
2642
|
+
expect(e.code).toEqual(1);
|
|
2643
|
+
done();
|
|
2644
|
+
});
|
|
2645
|
+
});
|
|
2646
|
+
});
|
|
2647
|
+
describe('getSwapsSourcesV2', () => {
|
|
2648
|
+
const args = constants_1.mockZeroExSourcesV2Request;
|
|
2649
|
+
const options = constants_1.mockZeroExOptions;
|
|
2650
|
+
const res = constants_1.mockZeroExSourcesV2Response;
|
|
2651
|
+
it('should successfully return the sources', (done) => {
|
|
2652
|
+
var _a;
|
|
2653
|
+
jest
|
|
2654
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2655
|
+
.mockImplementation((message, origin) => {
|
|
2656
|
+
const { type, data } = message;
|
|
2657
|
+
expect(type).toEqual('portal:swaps:getSourcesV2');
|
|
2658
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2659
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2660
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2661
|
+
origin: mockHostOrigin,
|
|
2662
|
+
data: {
|
|
2663
|
+
type: 'portal:swaps:getSourcesV2Result',
|
|
2664
|
+
data: res,
|
|
2665
|
+
},
|
|
2666
|
+
}));
|
|
2667
|
+
});
|
|
2668
|
+
mpc
|
|
2669
|
+
.getSwapsSourcesV2(args, options)
|
|
2670
|
+
.then((data) => {
|
|
2671
|
+
expect(data).toEqual(res);
|
|
2672
|
+
done();
|
|
2673
|
+
})
|
|
2674
|
+
.catch((_) => {
|
|
2675
|
+
expect(0).toEqual(1);
|
|
2676
|
+
done();
|
|
2677
|
+
});
|
|
2678
|
+
});
|
|
2679
|
+
it('should successfully return the sources without options', (done) => {
|
|
2680
|
+
var _a;
|
|
2681
|
+
jest
|
|
2682
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2683
|
+
.mockImplementation((message, origin) => {
|
|
2684
|
+
const { type, data } = message;
|
|
2685
|
+
expect(type).toEqual('portal:swaps:getSourcesV2');
|
|
2686
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options: undefined }));
|
|
2687
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2688
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2689
|
+
origin: mockHostOrigin,
|
|
2690
|
+
data: {
|
|
2691
|
+
type: 'portal:swaps:getSourcesV2Result',
|
|
2692
|
+
data: res,
|
|
2693
|
+
},
|
|
2694
|
+
}));
|
|
2695
|
+
});
|
|
2696
|
+
mpc
|
|
2697
|
+
.getSwapsSourcesV2(args)
|
|
2698
|
+
.then((data) => {
|
|
2699
|
+
expect(data).toEqual(res);
|
|
2700
|
+
done();
|
|
2701
|
+
})
|
|
2702
|
+
.catch((_) => {
|
|
2703
|
+
expect(0).toEqual(1);
|
|
2704
|
+
done();
|
|
2705
|
+
});
|
|
2706
|
+
});
|
|
2707
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2708
|
+
var _a;
|
|
2709
|
+
jest
|
|
2710
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2711
|
+
.mockImplementationOnce((message, origin) => {
|
|
2712
|
+
const { type, data } = message;
|
|
2713
|
+
expect(type).toEqual('portal:swaps:getSourcesV2');
|
|
2714
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2715
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2716
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2717
|
+
origin: mockHostOrigin,
|
|
2718
|
+
data: {
|
|
2719
|
+
type: 'portal:swaps:getSourcesV2Error',
|
|
2720
|
+
data: {
|
|
2721
|
+
code: 1,
|
|
2722
|
+
message: 'test',
|
|
2723
|
+
},
|
|
2724
|
+
},
|
|
2725
|
+
}));
|
|
2726
|
+
});
|
|
2727
|
+
mpc
|
|
2728
|
+
.getSwapsSourcesV2(args, options)
|
|
2729
|
+
.then(() => {
|
|
2730
|
+
expect(0).toEqual(1);
|
|
2731
|
+
done();
|
|
2732
|
+
})
|
|
2733
|
+
.catch((e) => {
|
|
2734
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
2735
|
+
expect(e.message).toEqual('test');
|
|
2736
|
+
expect(e.code).toEqual(1);
|
|
2737
|
+
done();
|
|
2738
|
+
});
|
|
2739
|
+
});
|
|
2740
|
+
});
|
|
2741
|
+
describe('getSwapsPrice', () => {
|
|
2742
|
+
const args = constants_1.mockZeroExPriceRequest;
|
|
2743
|
+
const options = constants_1.mockZeroExOptions;
|
|
2744
|
+
const res = constants_1.mockZeroExPriceResponse;
|
|
2745
|
+
it('should successfully return the price', (done) => {
|
|
2746
|
+
var _a;
|
|
2747
|
+
jest
|
|
2748
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2749
|
+
.mockImplementation((message, origin) => {
|
|
2750
|
+
const { type, data } = message;
|
|
2751
|
+
expect(type).toEqual('portal:swaps:getPrice');
|
|
2752
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2753
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2754
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2755
|
+
origin: mockHostOrigin,
|
|
2756
|
+
data: {
|
|
2757
|
+
type: 'portal:swaps:getPriceResult',
|
|
2758
|
+
data: res,
|
|
2759
|
+
},
|
|
2760
|
+
}));
|
|
2761
|
+
});
|
|
2762
|
+
mpc
|
|
2763
|
+
.getSwapsPrice(args, options)
|
|
2764
|
+
.then((data) => {
|
|
2765
|
+
expect(data).toEqual(res);
|
|
2766
|
+
done();
|
|
2767
|
+
})
|
|
2768
|
+
.catch((_) => {
|
|
2769
|
+
expect(0).toEqual(1);
|
|
2770
|
+
done();
|
|
2771
|
+
});
|
|
2772
|
+
});
|
|
2773
|
+
it('should successfully return the price without options', (done) => {
|
|
2774
|
+
var _a;
|
|
2775
|
+
jest
|
|
2776
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2777
|
+
.mockImplementation((message, origin) => {
|
|
2778
|
+
const { type, data } = message;
|
|
2779
|
+
expect(type).toEqual('portal:swaps:getPrice');
|
|
2780
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options: undefined }));
|
|
2781
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2782
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2783
|
+
origin: mockHostOrigin,
|
|
2784
|
+
data: {
|
|
2785
|
+
type: 'portal:swaps:getPriceResult',
|
|
2786
|
+
data: res,
|
|
2787
|
+
},
|
|
2788
|
+
}));
|
|
2789
|
+
});
|
|
2790
|
+
mpc
|
|
2791
|
+
.getSwapsPrice(args)
|
|
2792
|
+
.then((data) => {
|
|
2793
|
+
expect(data).toEqual(res);
|
|
2794
|
+
done();
|
|
2795
|
+
})
|
|
2796
|
+
.catch((_) => {
|
|
2797
|
+
expect(0).toEqual(1);
|
|
2798
|
+
done();
|
|
2799
|
+
});
|
|
2800
|
+
});
|
|
2801
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2802
|
+
var _a;
|
|
2803
|
+
jest
|
|
2804
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2805
|
+
.mockImplementationOnce((message, origin) => {
|
|
2806
|
+
const { type, data } = message;
|
|
2807
|
+
expect(type).toEqual('portal:swaps:getPrice');
|
|
2808
|
+
expect(data).toEqual(Object.assign(Object.assign({}, args), { options }));
|
|
2809
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2810
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2811
|
+
origin: mockHostOrigin,
|
|
2812
|
+
data: {
|
|
2813
|
+
type: 'portal:swaps:getPriceError',
|
|
2814
|
+
data: {
|
|
2815
|
+
code: 1,
|
|
2816
|
+
message: 'test',
|
|
2817
|
+
},
|
|
2818
|
+
},
|
|
2819
|
+
}));
|
|
2820
|
+
});
|
|
2821
|
+
mpc
|
|
2822
|
+
.getSwapsPrice(args, options)
|
|
2823
|
+
.then(() => {
|
|
2824
|
+
expect(0).toEqual(1);
|
|
2825
|
+
done();
|
|
2826
|
+
})
|
|
2827
|
+
.catch((e) => {
|
|
2828
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
2829
|
+
expect(e.message).toEqual('test');
|
|
2830
|
+
expect(e.code).toEqual(1);
|
|
2831
|
+
done();
|
|
2832
|
+
});
|
|
2833
|
+
});
|
|
2834
|
+
});
|
|
2835
|
+
describe('scanAddresses', () => {
|
|
2836
|
+
const args = constants_1.mockScanAddressesRequest;
|
|
2837
|
+
const res = constants_1.mockScanAddressesResponse;
|
|
2838
|
+
it('should successfully scan addresses', (done) => {
|
|
2839
|
+
var _a;
|
|
2840
|
+
jest
|
|
2841
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2842
|
+
.mockImplementation((message, origin) => {
|
|
2843
|
+
const { type, data } = message;
|
|
2844
|
+
expect(type).toEqual('portal:security:scanAddresses');
|
|
2845
|
+
expect(data).toEqual(args);
|
|
2846
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2847
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2848
|
+
origin: mockHostOrigin,
|
|
2849
|
+
data: {
|
|
2850
|
+
type: 'portal:security:scanAddressesResult',
|
|
2851
|
+
data: res,
|
|
2852
|
+
},
|
|
2853
|
+
}));
|
|
2854
|
+
});
|
|
2855
|
+
mpc
|
|
2856
|
+
.scanAddresses(args)
|
|
2857
|
+
.then((data) => {
|
|
2858
|
+
expect(data).toEqual(res);
|
|
2859
|
+
done();
|
|
2860
|
+
})
|
|
2861
|
+
.catch((_) => {
|
|
2862
|
+
expect(0).toEqual(1);
|
|
2863
|
+
done();
|
|
2864
|
+
});
|
|
2865
|
+
});
|
|
2866
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2867
|
+
var _a;
|
|
2868
|
+
jest
|
|
2869
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2870
|
+
.mockImplementationOnce((message, origin) => {
|
|
2871
|
+
const { type, data } = message;
|
|
2872
|
+
expect(type).toEqual('portal:security:scanAddresses');
|
|
2873
|
+
expect(data).toEqual(args);
|
|
2874
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2875
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2876
|
+
origin: mockHostOrigin,
|
|
2877
|
+
data: {
|
|
2878
|
+
type: 'portal:security:scanAddressesError',
|
|
2879
|
+
data: {
|
|
2880
|
+
code: 1,
|
|
2881
|
+
message: 'test',
|
|
2882
|
+
},
|
|
2883
|
+
},
|
|
2884
|
+
}));
|
|
2885
|
+
});
|
|
2886
|
+
mpc
|
|
2887
|
+
.scanAddresses(args)
|
|
2888
|
+
.then(() => {
|
|
2889
|
+
expect(0).toEqual(1);
|
|
2890
|
+
done();
|
|
2891
|
+
})
|
|
2892
|
+
.catch((e) => {
|
|
2893
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
2894
|
+
expect(e.message).toEqual('test');
|
|
2895
|
+
expect(e.code).toEqual(1);
|
|
2896
|
+
done();
|
|
2897
|
+
});
|
|
2898
|
+
});
|
|
2899
|
+
});
|
|
2900
|
+
describe('scanEVMTx', () => {
|
|
2901
|
+
const args = constants_1.mockScanEVMTxRequest;
|
|
2902
|
+
const res = constants_1.mockScanEVMTxResponse;
|
|
2903
|
+
it('should successfully scan EIP-155 transaction', (done) => {
|
|
2904
|
+
var _a;
|
|
2905
|
+
jest
|
|
2906
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2907
|
+
.mockImplementation((message, origin) => {
|
|
2908
|
+
const { type, data } = message;
|
|
2909
|
+
expect(type).toEqual('portal:security:scanEVMTx');
|
|
2910
|
+
expect(data).toEqual(args);
|
|
2911
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2912
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2913
|
+
origin: mockHostOrigin,
|
|
2914
|
+
data: {
|
|
2915
|
+
type: 'portal:security:scanEVMTxResult',
|
|
2916
|
+
data: res,
|
|
2917
|
+
},
|
|
2918
|
+
}));
|
|
2919
|
+
});
|
|
2920
|
+
mpc
|
|
2921
|
+
.scanEVMTx(args)
|
|
2922
|
+
.then((data) => {
|
|
2923
|
+
expect(data).toEqual(res);
|
|
2924
|
+
done();
|
|
2925
|
+
})
|
|
2926
|
+
.catch((_) => {
|
|
2927
|
+
expect(0).toEqual(1);
|
|
2928
|
+
done();
|
|
2929
|
+
});
|
|
2930
|
+
});
|
|
2931
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2932
|
+
var _a;
|
|
2933
|
+
jest
|
|
2934
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2935
|
+
.mockImplementationOnce((message, origin) => {
|
|
2936
|
+
const { type, data } = message;
|
|
2937
|
+
expect(type).toEqual('portal:security:scanEVMTx');
|
|
2938
|
+
expect(data).toEqual(args);
|
|
2939
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2940
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2941
|
+
origin: mockHostOrigin,
|
|
2942
|
+
data: {
|
|
2943
|
+
type: 'portal:security:scanEVMTxError',
|
|
2944
|
+
data: {
|
|
2945
|
+
code: 1,
|
|
2946
|
+
message: 'test',
|
|
2947
|
+
},
|
|
2948
|
+
},
|
|
2949
|
+
}));
|
|
2950
|
+
});
|
|
2951
|
+
mpc
|
|
2952
|
+
.scanEVMTx(args)
|
|
2953
|
+
.then(() => {
|
|
2954
|
+
expect(0).toEqual(1);
|
|
2955
|
+
done();
|
|
2956
|
+
})
|
|
2957
|
+
.catch((e) => {
|
|
2958
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
2959
|
+
expect(e.message).toEqual('test');
|
|
2960
|
+
expect(e.code).toEqual(1);
|
|
2961
|
+
done();
|
|
2962
|
+
});
|
|
2963
|
+
});
|
|
2964
|
+
});
|
|
2965
|
+
describe('scanEip712Tx', () => {
|
|
2966
|
+
const args = constants_1.mockScanEip712TxRequest;
|
|
2967
|
+
const res = constants_1.mockScanEip712TxResponse;
|
|
2968
|
+
it('should successfully scan EIP-712 transaction', (done) => {
|
|
2969
|
+
var _a;
|
|
2970
|
+
jest
|
|
2971
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
2972
|
+
.mockImplementation((message, origin) => {
|
|
2973
|
+
const { type, data } = message;
|
|
2974
|
+
expect(type).toEqual('portal:security:scanEip712Tx');
|
|
2975
|
+
expect(data).toEqual(args);
|
|
2976
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
2977
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
2978
|
+
origin: mockHostOrigin,
|
|
2979
|
+
data: {
|
|
2980
|
+
type: 'portal:security:scanEip712TxResult',
|
|
2981
|
+
data: res,
|
|
2982
|
+
},
|
|
2983
|
+
}));
|
|
2984
|
+
});
|
|
2985
|
+
mpc
|
|
2986
|
+
.scanEip712Tx(args)
|
|
2987
|
+
.then((data) => {
|
|
2988
|
+
expect(data).toEqual(res);
|
|
2989
|
+
done();
|
|
2990
|
+
})
|
|
2991
|
+
.catch((_) => {
|
|
2992
|
+
expect(0).toEqual(1);
|
|
2993
|
+
done();
|
|
2994
|
+
});
|
|
2995
|
+
});
|
|
2996
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
2997
|
+
var _a;
|
|
2998
|
+
jest
|
|
2999
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3000
|
+
.mockImplementationOnce((message, origin) => {
|
|
3001
|
+
const { type, data } = message;
|
|
3002
|
+
expect(type).toEqual('portal:security:scanEip712Tx');
|
|
3003
|
+
expect(data).toEqual(args);
|
|
3004
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3005
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3006
|
+
origin: mockHostOrigin,
|
|
3007
|
+
data: {
|
|
3008
|
+
type: 'portal:security:scanEip712TxError',
|
|
3009
|
+
data: {
|
|
3010
|
+
code: 1,
|
|
3011
|
+
message: 'test',
|
|
3012
|
+
},
|
|
3013
|
+
},
|
|
3014
|
+
}));
|
|
3015
|
+
});
|
|
3016
|
+
mpc
|
|
3017
|
+
.scanEip712Tx(args)
|
|
3018
|
+
.then(() => {
|
|
3019
|
+
expect(0).toEqual(1);
|
|
3020
|
+
done();
|
|
3021
|
+
})
|
|
3022
|
+
.catch((e) => {
|
|
3023
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
3024
|
+
expect(e.message).toEqual('test');
|
|
3025
|
+
expect(e.code).toEqual(1);
|
|
3026
|
+
done();
|
|
3027
|
+
});
|
|
3028
|
+
});
|
|
3029
|
+
});
|
|
3030
|
+
describe('scanSolanaTx', () => {
|
|
3031
|
+
const args = constants_1.mockScanSolanaTxRequest;
|
|
3032
|
+
const res = constants_1.mockScanSolanaTxResponse;
|
|
3033
|
+
it('should successfully scan Solana transaction', (done) => {
|
|
3034
|
+
var _a;
|
|
3035
|
+
jest
|
|
3036
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3037
|
+
.mockImplementation((message, origin) => {
|
|
3038
|
+
const { type, data } = message;
|
|
3039
|
+
expect(type).toEqual('portal:security:scanSolanaTx');
|
|
3040
|
+
expect(data).toEqual(args);
|
|
3041
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3042
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3043
|
+
origin: mockHostOrigin,
|
|
3044
|
+
data: {
|
|
3045
|
+
type: 'portal:security:scanSolanaTxResult',
|
|
3046
|
+
data: res,
|
|
3047
|
+
},
|
|
3048
|
+
}));
|
|
3049
|
+
});
|
|
3050
|
+
mpc
|
|
3051
|
+
.scanSolanaTx(args)
|
|
3052
|
+
.then((data) => {
|
|
3053
|
+
expect(data).toEqual(res);
|
|
3054
|
+
done();
|
|
3055
|
+
})
|
|
3056
|
+
.catch((_) => {
|
|
3057
|
+
expect(0).toEqual(1);
|
|
3058
|
+
done();
|
|
3059
|
+
});
|
|
3060
|
+
});
|
|
3061
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
3062
|
+
var _a;
|
|
3063
|
+
jest
|
|
3064
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3065
|
+
.mockImplementationOnce((message, origin) => {
|
|
3066
|
+
const { type, data } = message;
|
|
3067
|
+
expect(type).toEqual('portal:security:scanSolanaTx');
|
|
3068
|
+
expect(data).toEqual(args);
|
|
3069
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3070
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3071
|
+
origin: mockHostOrigin,
|
|
3072
|
+
data: {
|
|
3073
|
+
type: 'portal:security:scanSolanaTxError',
|
|
3074
|
+
data: {
|
|
3075
|
+
code: 1,
|
|
3076
|
+
message: 'test',
|
|
3077
|
+
},
|
|
3078
|
+
},
|
|
3079
|
+
}));
|
|
3080
|
+
});
|
|
3081
|
+
mpc
|
|
3082
|
+
.scanSolanaTx(args)
|
|
3083
|
+
.then(() => {
|
|
3084
|
+
expect(0).toEqual(1);
|
|
3085
|
+
done();
|
|
3086
|
+
})
|
|
3087
|
+
.catch((e) => {
|
|
3088
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
3089
|
+
expect(e.message).toEqual('test');
|
|
3090
|
+
expect(e.code).toEqual(1);
|
|
3091
|
+
done();
|
|
3092
|
+
});
|
|
3093
|
+
});
|
|
3094
|
+
});
|
|
3095
|
+
describe('scanNft', () => {
|
|
3096
|
+
const args = constants_1.mockScanNftRequest;
|
|
3097
|
+
const res = constants_1.mockScanNftResponse;
|
|
3098
|
+
it('should successfully scan NFT', (done) => {
|
|
3099
|
+
var _a;
|
|
3100
|
+
jest
|
|
3101
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3102
|
+
.mockImplementation((message, origin) => {
|
|
3103
|
+
const { type, data } = message;
|
|
3104
|
+
expect(type).toEqual('portal:security:scanNfts');
|
|
3105
|
+
expect(data).toEqual(args);
|
|
3106
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3107
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3108
|
+
origin: mockHostOrigin,
|
|
3109
|
+
data: {
|
|
3110
|
+
type: 'portal:security:scanNftsResult',
|
|
3111
|
+
data: res,
|
|
3112
|
+
},
|
|
3113
|
+
}));
|
|
3114
|
+
});
|
|
3115
|
+
mpc
|
|
3116
|
+
.scanNFTs(args)
|
|
3117
|
+
.then((data) => {
|
|
3118
|
+
expect(data).toEqual(res);
|
|
3119
|
+
done();
|
|
3120
|
+
})
|
|
3121
|
+
.catch((_) => {
|
|
3122
|
+
expect(0).toEqual(1);
|
|
3123
|
+
done();
|
|
3124
|
+
});
|
|
3125
|
+
});
|
|
3126
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
3127
|
+
var _a;
|
|
3128
|
+
jest
|
|
3129
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3130
|
+
.mockImplementationOnce((message, origin) => {
|
|
3131
|
+
const { type, data } = message;
|
|
3132
|
+
expect(type).toEqual('portal:security:scanNfts');
|
|
3133
|
+
expect(data).toEqual(args);
|
|
3134
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3135
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3136
|
+
origin: mockHostOrigin,
|
|
3137
|
+
data: {
|
|
3138
|
+
type: 'portal:security:scanNftsError',
|
|
3139
|
+
data: {
|
|
3140
|
+
code: 1,
|
|
3141
|
+
message: 'test',
|
|
3142
|
+
},
|
|
3143
|
+
},
|
|
3144
|
+
}));
|
|
3145
|
+
});
|
|
3146
|
+
mpc
|
|
3147
|
+
.scanNFTs(args)
|
|
3148
|
+
.then(() => {
|
|
3149
|
+
expect(0).toEqual(1);
|
|
3150
|
+
done();
|
|
3151
|
+
})
|
|
3152
|
+
.catch((e) => {
|
|
3153
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
3154
|
+
expect(e.message).toEqual('test');
|
|
3155
|
+
expect(e.code).toEqual(1);
|
|
3156
|
+
done();
|
|
3157
|
+
});
|
|
3158
|
+
});
|
|
3159
|
+
});
|
|
3160
|
+
describe('scanToken', () => {
|
|
3161
|
+
const args = constants_1.mockScanTokenRequest;
|
|
3162
|
+
const res = constants_1.mockScanTokenResponse;
|
|
3163
|
+
it('should successfully scan token', (done) => {
|
|
3164
|
+
var _a;
|
|
3165
|
+
jest
|
|
3166
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3167
|
+
.mockImplementation((message, origin) => {
|
|
3168
|
+
const { type, data } = message;
|
|
3169
|
+
expect(type).toEqual('portal:security:scanTokens');
|
|
3170
|
+
expect(data).toEqual(args);
|
|
3171
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3172
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3173
|
+
origin: mockHostOrigin,
|
|
3174
|
+
data: {
|
|
3175
|
+
type: 'portal:security:scanTokensResult',
|
|
3176
|
+
data: res,
|
|
3177
|
+
},
|
|
3178
|
+
}));
|
|
3179
|
+
});
|
|
3180
|
+
mpc
|
|
3181
|
+
.scanTokens(args)
|
|
3182
|
+
.then((data) => {
|
|
3183
|
+
expect(data).toEqual(res);
|
|
3184
|
+
done();
|
|
3185
|
+
})
|
|
3186
|
+
.catch((_) => {
|
|
3187
|
+
expect(0).toEqual(1);
|
|
3188
|
+
done();
|
|
3189
|
+
});
|
|
3190
|
+
});
|
|
3191
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
3192
|
+
var _a;
|
|
3193
|
+
jest
|
|
3194
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3195
|
+
.mockImplementationOnce((message, origin) => {
|
|
3196
|
+
const { type, data } = message;
|
|
3197
|
+
expect(type).toEqual('portal:security:scanTokens');
|
|
3198
|
+
expect(data).toEqual(args);
|
|
3199
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3200
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3201
|
+
origin: mockHostOrigin,
|
|
3202
|
+
data: {
|
|
3203
|
+
type: 'portal:security:scanTokensError',
|
|
3204
|
+
data: {
|
|
3205
|
+
code: 1,
|
|
3206
|
+
message: 'test',
|
|
3207
|
+
},
|
|
3208
|
+
},
|
|
3209
|
+
}));
|
|
3210
|
+
});
|
|
3211
|
+
mpc
|
|
3212
|
+
.scanTokens(args)
|
|
3213
|
+
.then(() => {
|
|
3214
|
+
expect(0).toEqual(1);
|
|
3215
|
+
done();
|
|
3216
|
+
})
|
|
3217
|
+
.catch((e) => {
|
|
3218
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
3219
|
+
expect(e.message).toEqual('test');
|
|
3220
|
+
expect(e.code).toEqual(1);
|
|
3221
|
+
done();
|
|
3222
|
+
});
|
|
3223
|
+
});
|
|
3224
|
+
});
|
|
3225
|
+
describe('scanUrl', () => {
|
|
3226
|
+
const args = constants_1.mockScanUrlRequest;
|
|
3227
|
+
const res = constants_1.mockScanUrlResponse;
|
|
3228
|
+
it('should successfully scan URL', (done) => {
|
|
3229
|
+
var _a;
|
|
3230
|
+
jest
|
|
3231
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3232
|
+
.mockImplementation((message, origin) => {
|
|
3233
|
+
const { type, data } = message;
|
|
3234
|
+
expect(type).toEqual('portal:security:scanUrl');
|
|
3235
|
+
expect(data).toEqual({ url: args });
|
|
3236
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3237
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3238
|
+
origin: mockHostOrigin,
|
|
3239
|
+
data: {
|
|
3240
|
+
type: 'portal:security:scanUrlResult',
|
|
3241
|
+
data: res,
|
|
3242
|
+
},
|
|
3243
|
+
}));
|
|
3244
|
+
});
|
|
3245
|
+
mpc
|
|
3246
|
+
.scanUrl(args)
|
|
3247
|
+
.then((data) => {
|
|
3248
|
+
expect(data).toEqual(res);
|
|
3249
|
+
done();
|
|
3250
|
+
})
|
|
3251
|
+
.catch((_) => {
|
|
3252
|
+
expect(0).toEqual(1);
|
|
3253
|
+
done();
|
|
3254
|
+
});
|
|
3255
|
+
});
|
|
3256
|
+
it('should error out if the iframe sends an error message', (done) => {
|
|
3257
|
+
var _a;
|
|
3258
|
+
jest
|
|
3259
|
+
.spyOn((_a = mpc.iframe) === null || _a === void 0 ? void 0 : _a.contentWindow, 'postMessage')
|
|
3260
|
+
.mockImplementationOnce((message, origin) => {
|
|
3261
|
+
const { type, data } = message;
|
|
3262
|
+
expect(type).toEqual('portal:security:scanUrl');
|
|
3263
|
+
expect(data).toEqual({ url: args });
|
|
3264
|
+
expect(origin).toEqual(mockHostOrigin);
|
|
3265
|
+
window.dispatchEvent(new MessageEvent('message', {
|
|
3266
|
+
origin: mockHostOrigin,
|
|
3267
|
+
data: {
|
|
3268
|
+
type: 'portal:security:scanUrlError',
|
|
3269
|
+
data: {
|
|
3270
|
+
code: 1,
|
|
3271
|
+
message: 'test',
|
|
3272
|
+
},
|
|
3273
|
+
},
|
|
3274
|
+
}));
|
|
3275
|
+
});
|
|
3276
|
+
mpc
|
|
3277
|
+
.scanUrl(args)
|
|
3278
|
+
.then(() => {
|
|
3279
|
+
expect(0).toEqual(1);
|
|
3280
|
+
done();
|
|
3281
|
+
})
|
|
3282
|
+
.catch((e) => {
|
|
3283
|
+
expect(e).toBeInstanceOf(errors_1.PortalMpcError);
|
|
3284
|
+
expect(e.message).toEqual('test');
|
|
3285
|
+
expect(e.code).toEqual(1);
|
|
3286
|
+
done();
|
|
3287
|
+
});
|
|
3288
|
+
});
|
|
3289
|
+
});
|
|
2501
3290
|
});
|