Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Aug 28, 2023
1 parent fd64023 commit 9297f16
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ module.exports = {
},
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/jest/setup.js', './node_modules/@react-native-google-signin/google-signin/jest/build/setup.js'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect'],
setupFilesAfterEnv: ['@testing-library/jest-native/extend-expect', '<rootDir>/jest/setupAfterEnv.js'],
cacheDirectory: '<rootDir>/.jest-cache',
};
1 change: 1 addition & 0 deletions jest/setupAfterEnv.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.useRealTimers();
1 change: 0 additions & 1 deletion tests/unit/APITest.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import * as SequentialQueue from '../../src/libs/Network/SequentialQueue';
import * as Request from '../../src/libs/Request';

jest.mock('../../src/libs/Log');
jest.useFakeTimers();

Onyx.init({
keys: ONYXKEYS,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/NetworkTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import * as App from '../../src/libs/actions/App';
import NetworkConnection from '../../src/libs/NetworkConnection';

jest.mock('../../src/libs/Log');
jest.useFakeTimers();

Onyx.init({
keys: ONYXKEYS,
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/waitForPromisesToResolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*
* @returns {Promise}
*/
export default () => new Promise(setImmediate);
export default () => new Promise((resolve) => setTimeout(resolve, 0));

0 comments on commit 9297f16

Please sign in to comment.