Skip to content

Commit

Permalink
Dev to Main Sync (#180)
Browse files Browse the repository at this point in the history
Fixed test setup

Co-authored-by: Ashif Khan <[email protected]>
  • Loading branch information
Achintya-Chatterjee and ashifkhn authored Oct 5, 2024
1 parent f6f26bc commit 3008b2b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
testEnvironmentOptions: {
customExportConditions: [''],
},
};

module.exports = createJestConfig(customJestConfig);
6 changes: 0 additions & 6 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
import '@testing-library/jest-dom';
import './setupTests';
import 'whatwg-fetch';

// jest.config.js
module.exports = {
setupFilesAfterEnv: ['@testing-library/jest-dom', './jest.setup.ts'],
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"local-ssl-proxy": "^2.0.5",
"msw": "^2.3.5",
"msw": "^2.4.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
Expand Down
1 change: 1 addition & 0 deletions setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { server } from './src/mocks/server';
import { beforeAll, afterEach, afterAll } from '@jest/globals';

beforeAll(() => server.listen({ onUnhandledRequest: 'error' }));

Expand Down
14 changes: 4 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3854,11 +3854,6 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9:
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==

graphql@^16.8.1:
version "16.9.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.9.0.tgz#1c310e63f16a49ce1fbb230bd0a000e99f6f115f"
integrity sha512-GGTKBX4SD7Wdb8mqeDLni2oaRGYQWjWHGKPQ24ZMnUtKfcsVoiv4uX8+LJr1K6U5VW2Lu1BwJnj7uiori0YtRw==

has-bigints@^1.0.1, has-bigints@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa"
Expand Down Expand Up @@ -5076,10 +5071,10 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

msw@^2.3.5:
version "2.3.5"
resolved "https://registry.yarnpkg.com/msw/-/msw-2.3.5.tgz#424ad91b20a548d6b77fc26aca0c789e5cbc4764"
integrity sha512-+GUI4gX5YC5Bv33epBrD+BGdmDvBg2XGruiWnI3GbIbRmMMBeZ5gs3mJ51OWSGHgJKztZ8AtZeYMMNMVrje2/Q==
msw@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/msw/-/msw-2.4.1.tgz#bb0ead0311de39d5847ff0836b9dd67e7bba02b8"
integrity sha512-HXcoQPzYTwEmVk+BGIcRa0vLabBT+J20SSSeYh/QfajaK5ceA6dlD4ZZjfz2dqGEq4vRNCPLP6eXsB94KllPFg==
dependencies:
"@bundled-es-modules/cookie" "^2.0.0"
"@bundled-es-modules/statuses" "^1.0.1"
Expand All @@ -5090,7 +5085,6 @@ msw@^2.3.5:
"@types/cookie" "^0.6.0"
"@types/statuses" "^2.0.4"
chalk "^4.1.2"
graphql "^16.8.1"
headers-polyfill "^4.0.2"
is-node-process "^1.2.0"
outvariant "^1.4.2"
Expand Down

0 comments on commit 3008b2b

Please sign in to comment.