mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
TST: fix mocks
This commit is contained in:
parent
b3507587af
commit
d722f031f8
@ -13,6 +13,7 @@ import {
|
|||||||
} from '../../class';
|
} from '../../class';
|
||||||
import WalletImport from '../../class/wallet-import';
|
import WalletImport from '../../class/wallet-import';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import Notifications from '../../blue_modules/notifications';
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
global.net = require('net'); // needed by Electrum client. For RN it is proviced in shim.js
|
global.net = require('net'); // needed by Electrum client. For RN it is proviced in shim.js
|
||||||
global.tls = require('tls'); // needed by Electrum client. For RN it is proviced in shim.js
|
global.tls = require('tls'); // needed by Electrum client. For RN it is proviced in shim.js
|
||||||
@ -33,6 +34,12 @@ React.useContext = jest.fn(() => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
jest.mock('../../blue_modules/notifications', () => {
|
||||||
|
return {
|
||||||
|
majorTomToGroundControl: jest.fn(),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
jest.mock('../../blue_modules/prompt', () => {
|
jest.mock('../../blue_modules/prompt', () => {
|
||||||
return jest.fn(() => {
|
return jest.fn(() => {
|
||||||
return 'qwerty';
|
return 'qwerty';
|
||||||
@ -50,7 +57,8 @@ beforeAll(async () => {
|
|||||||
// awaiting for Electrum to be connected. For RN Electrum would naturally connect
|
// awaiting for Electrum to be connected. For RN Electrum would naturally connect
|
||||||
// while app starts up, but for tests we need to wait for it
|
// while app starts up, but for tests we need to wait for it
|
||||||
await BlueElectrum.waitTillConnected();
|
await BlueElectrum.waitTillConnected();
|
||||||
WalletImport(); // wut
|
WalletImport(); // damn i love javascript
|
||||||
|
Notifications(); // damn i love javascript
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('import procedure', function () {
|
describe('import procedure', function () {
|
||||||
|
@ -128,10 +128,4 @@ jest.mock('../blue_modules/analytics', () => {
|
|||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('../blue_modules/notifications', () => {
|
|
||||||
return {
|
|
||||||
majorTomToGroundControl: jest.fn(),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
global.alert = () => {};
|
global.alert = () => {};
|
||||||
|
Loading…
Reference in New Issue
Block a user