Skip to content

Commit

Permalink
test(connect): ignore disposed error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Dec 3, 2024
1 parent 6a86971 commit 11188ee
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions packages/connect/e2e/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ if (process.env.TESTS_USE_WS_CACHE === 'true') {
});
}

console.log('Jest setup loaded');

Check warning on line 16 in packages/connect/e2e/jest.setup.js

View workflow job for this annotation

GitHub Actions / Linting and formatting

Unexpected console statement

process.on('unhandledRejection', error => {
console.error('unhandledRejection', error);
if (error.message === 'Disposed') {
// Ignored
return;
}
throw error;
});

process.on('uncaughtException', error => {
console.error('uncaughtException', error);
throw error;
});

global.TestUtils = {
...global.TestUtils,
TX_CACHE,
Expand Down
6 changes: 5 additions & 1 deletion packages/connect/e2e/tests/api/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ const INIT_ERROR = { code: 'Init_ManifestMissing' };

describe('TrezorConnect.init', () => {
afterEach(() => {
TrezorConnect.dispose();
try {
TrezorConnect.dispose();
} catch {
// do nothing
}
});

beforeAll(() => {
Expand Down

0 comments on commit 11188ee

Please sign in to comment.