Skip to content

Commit

Permalink
chore(connect): remove await from TrezorConnect.dispose since it is n…
Browse files Browse the repository at this point in the history
…ot avaitable
  • Loading branch information
mroz22 committed Nov 21, 2024
1 parent 20b3e2a commit 596aebd
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export const init =
export const onSubmitInit = () => async (dispatch: Dispatch, getState: GetState) => {
const { connect } = getState();
// Disposing TrezorConnect to init it again.
await TrezorConnect.dispose();
TrezorConnect.dispose();
await TrezorConnectMobile.dispose();

return dispatch(init(connect.options));
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/authenticateDevice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ describe('TrezorConnect.authenticateDevice', () => {
await initTrezorConnect(controller);
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

// NOTE: emulator uses different provisioning keys than production FW (different than ./data/deviceAuthenticityConfig)
Expand Down
6 changes: 3 additions & 3 deletions packages/connect/e2e/tests/device/authorizeCoinjoin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('TrezorConnect.authorizeCoinjoin', () => {

beforeEach(async () => {
// restart connect for each test (working with event listeners)
await TrezorConnect.dispose();
TrezorConnect.dispose();

await initTrezorConnect(controller, { debug: false });

Expand All @@ -27,9 +27,9 @@ describe('TrezorConnect.authorizeCoinjoin', () => {
});
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

conditionalTest(['1', '<2.5.4'], 'Coinjoin success', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/cancel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ describe('TrezorConnect.cancel', () => {
});

afterAll(async () => {
await TrezorConnect.dispose();
TrezorConnect.dispose();
controller.dispose();
});

afterEach(async () => {
await TrezorConnect.dispose();
TrezorConnect.dispose();
await controller.stopEmu();
await controller.stopBridge();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ describe('TrezorConnect.cancelCoinjoinAuthorization', () => {

beforeEach(async () => {
// restart connect for each test (working with event listeners)
await TrezorConnect.dispose();
TrezorConnect.dispose();
await initTrezorConnect(controller, { debug: false });
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

conditionalTest(['1', '<2.5.4'], 'Cancel authorization works', async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/connect/e2e/tests/device/info.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { getController, initTrezorConnect } from '../../common.setup';

describe('__info common param', () => {
beforeAll(async () => {
await TrezorConnect.dispose();
TrezorConnect.dispose();

await initTrezorConnect(getController());
});

afterAll(async () => {
await TrezorConnect.dispose();
afterAll(() => {
TrezorConnect.dispose();
});

it('common param __info - only method info is returned', async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/connect/e2e/tests/device/keepSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const controller = getController();

describe('keepSession common param', () => {
beforeAll(async () => {
await TrezorConnect.dispose();
TrezorConnect.dispose();
await setup(controller, {
mnemonic: 'mnemonic_all',
passphrase_protection: true,
});
await initTrezorConnect(controller);
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

conditionalTest(['1', '<2.3.2'], 'keepSession with changing useCardanoDerivation', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/connect/e2e/tests/device/methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe(`TrezorConnect methods`, () => {
getFixtures().forEach((testCase: TestCase) => {
describe(`TrezorConnect.${testCase.method}`, () => {
beforeAll(async () => {
await TrezorConnect.dispose();
TrezorConnect.dispose();

try {
if (!controller) {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/override.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe('TrezorConnect override param', () => {
await initTrezorConnect(controller);
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

[1, 10, 100, 300, 500, 1000, 1500].forEach(delay => {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/passphrase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ describe('TrezorConnect passphrase', () => {
await initTrezorConnect(controller, { debug: false });
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

it('Using multiple passphrases at the same time', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/setBusy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ describe('TrezorConnect.setBusy', () => {
await initTrezorConnect(controller);
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

conditionalTest(['1', '<2.5.3'], 'setBusy timeout', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/e2e/tests/device/unlockPath.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe('TrezorConnect.unlockPath', () => {
await initTrezorConnect(controller);
});

afterAll(async () => {
afterAll(() => {
controller.dispose();
await TrezorConnect.dispose();
TrezorConnect.dispose();
});

conditionalTest(['1', '<2.5.3'], 'Unlock SLIP-25 + getAddress', async () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/suite/src/hooks/wallet/__tests__/useRbfForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ describe('useRbfForm hook', () => {
});
jest.spyOn(window, 'scrollTo').mockImplementation(() => {});
});
afterAll(async () => {
await TrezorConnect.dispose();
afterAll(() => {
TrezorConnect.dispose();
});
afterEach(() => {
jest.clearAllMocks();
Expand Down

0 comments on commit 596aebd

Please sign in to comment.