Skip to content

Commit

Permalink
attempt to fix component-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Sep 30, 2023
1 parent 4c7a0ca commit 40859b0
Show file tree
Hide file tree
Showing 6 changed files with 527 additions and 851 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,15 @@ component-test-watch: export COMPONENT_TEST := true
component-test-watch: export BABEL_ENV := test
component-test-watch: ##@ Watch tests and re-run no changes to cljs files
yarn install
nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js' -e cljs
nodemon --exec 'yarn shadow-cljs compile component-test && jest --config=test/jest/jest.config.js --testEnvironment node ' -e cljs

component-test: export TARGET := clojure
component-test: export COMPONENT_TEST := true
component-test: export BABEL_ENV := test
component-test: ##@test Run component tests once in NodeJS
yarn install
yarn shadow-cljs compile component-test && \
jest --config=test/jest/jest.config.js
jest --clearCache && jest --config=test/jest/jest.config.js --testEnvironment node

#--------------
# Other
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
'@babel/preset-env',
{
targets: {
node: '14',
node: 'current',
},
},
],
Expand Down
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@
"tdigest": "^0.1.1"
},
"devDependencies": {
"@babel/generator": "7.0.0",
"@babel/helper-builder-react-jsx": "7.0.0",
"@babel/plugin-transform-block-scoping": "7.0.0",
"@babel/generator": "^7.20.0",
"@babel/helper-builder-react-jsx": "^7.20.0",
"@babel/plugin-transform-block-scoping": "^7.20.0",
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/preset-react": "^7.18.6",
"@babel/register": "7.0.0",
Expand All @@ -90,14 +91,16 @@
"@testing-library/jest-native": "^5.0.0",
"@testing-library/react-native": "^11.2.0",
"@tsconfig/react-native": "^3.0.0",
"@types/jest": "^29.2.1",
"@types/jest": "^28.1.6",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.7.0",
"concurrently": "^7.6.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.76.8",
"jest": "^26.6.3",
"jest-circus": "^26.0.0",
"jest-environment-node": "^26.6.2",
"jest-image-snapshot": "^5.1.0",
"metro-react-native-babel-preset": "0.76.8",
"nodemon": "^2.0.16",
"nyc": "^14.1.1",
"prettier": "^2.8.8",
Expand Down
2 changes: 1 addition & 1 deletion test/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
},
testTimeout: 60000,
transformIgnorePatterns: [
'/node_modules/(?!(@react-native|react-native-haptic-feedback|react-native-redash|react-native-image-crop-picker|@react-native-community|react-native-linear-gradient|react-native-background-timer|react-native|rn-emoji-keyboard|react-native-languages|react-native-shake|react-native-reanimated|react-native-redash|react-native-permissions|@react-native-community/blur|react-native-static-safe-area-insets|react-native-gifted-charts)/).*/',
'/node_modules/(?!(@react-native|react-native-haptic-feedback|react-native-redash|react-native-image-crop-picker|@react-native-community|react-native-linear-gradient|react-native-background-timer|react-native|rn-emoji-keyboard|react-native-languages|react-native-shake|react-native-reanimated|react-native-redash|react-native-permissions|@react-native-community/blur|react-native-static-safe-area-insets|react-native-hole-view|react-native-gifted-charts)/).*/',
],
globals: {
__TEST__: true,
Expand Down
2 changes: 1 addition & 1 deletion test/jest/jestSetup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { NativeModules } = require('react-native');

require('@react-native-async-storage/async-storage/jest/async-storage-mock');
require('react-native-gesture-handler/jestSetup');
require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests();
require('react-native-reanimated/src/reanimated2/jestUtils').setUpTests();

jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);

Expand Down
Loading

0 comments on commit 40859b0

Please sign in to comment.