mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 18:00:17 +01:00
3b4b1d8df7
After the conversion of LegacyWallet to typescript, BlueElectrum is often included automatically and tries to connect ASAP. Dedicated management code is necessary in beforeAll/afterAll so that the tests can run and terminate gracefully.
18 lines
722 B
JavaScript
18 lines
722 B
JavaScript
import assert from 'assert';
|
|
|
|
import Notifications from '../../blue_modules/notifications';
|
|
Notifications.default = new Notifications();
|
|
|
|
describe('notifications', () => {
|
|
it('can check groundcontrol server uri validity', async () => {
|
|
assert.ok(await Notifications.isGroundControlUriValid('https://groundcontrol-bluewallet.herokuapp.com'));
|
|
assert.ok(!(await Notifications.isGroundControlUriValid('https://www.google.com')));
|
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
});
|
|
|
|
// muted because it causes jest to hang waiting indefinitely
|
|
it.skip('can check non-responding url', async () => {
|
|
assert.ok(!(await Notifications.isGroundControlUriValid('https://localhost.com')));
|
|
});
|
|
});
|