about summary refs log tree commit diff
path: root/package.json
diff options
context:
space:
mode:
authorJoão Ferreiro <ferreiro@pinkroom.dev>2022-12-22 15:32:39 +0000
committerGitHub <noreply@github.com>2022-12-22 09:32:39 -0600
commit7517b65dcd676f36d38f31c991929c32168b3e12 (patch)
tree65793d2575b205365c2997b4bbddc1ba6424d2ba /package.json
parent4913a07e3365d2004e67e9131dd4b4c15094dd33 (diff)
downloadvoidsky-7517b65dcd676f36d38f31c991929c32168b3e12.tar.zst
Unit testing (#32)
* add testing lib

* remove coverage folder from git

* finished basic test setup

* fix tests typescript and import paths

* add first snapshot

* testing utils

* rename test files; update script flags; ++tests

* testing utils functions

* testing downloadAndResize wip

* remove download test

* specify unwanted coverage paths;
remove update snapshots flag

* fix strings tests

* testing downloadAndResize method

* increasing testing

* fixing snapshots wip

* fixed shell mobile snapshot

* adding snapshots for the screens

* fix onboard snapshot

* fix typescript issues

* fix TabsSelector snapshot

* Account for testing device's locale in ago() tests

* Remove platform detection on regex

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'package.json')
-rw-r--r--package.json18
1 files changed, 15 insertions, 3 deletions
diff --git a/package.json b/package.json
index 73abfc5fd..3a11ba35f 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,9 @@
     "web": "react-scripts start",
     "start": "react-native start",
     "clean-cache": "rm -rf node_modules/.cache/babel-loader/*",
-    "test": "jest",
-    "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
+    "test": "jest --coverage",
+    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
+    "postinstall": "patch-package"
   },
   "dependencies": {
     "@atproto/api": "^0.0.2",
@@ -31,6 +32,7 @@
     "lru_map": "^0.4.1",
     "mobx": "^6.6.1",
     "mobx-react-lite": "^3.4.0",
+    "patch-package": "^6.5.0",
     "react": "17.0.2",
     "react-circular-progressbar": "^2.1.0",
     "react-dom": "17.0.2",
@@ -61,6 +63,8 @@
     "@babel/core": "^7.12.9",
     "@babel/runtime": "^7.12.5",
     "@react-native-community/eslint-config": "^2.0.0",
+    "@testing-library/jest-native": "^5.3.3",
+    "@testing-library/react-native": "^11.5.0",
     "@types/he": "^1.1.2",
     "@types/jest": "^26.0.23",
     "@types/lodash.chunk": "^4.2.7",
@@ -85,8 +89,10 @@
   "jest": {
     "preset": "react-native",
     "setupFiles": [
-      "./jest.js"
+      "./jest/jestSetup.js",
+      "./node_modules/react-native-gesture-handler/jestSetup.js"
     ],
+    "setupFilesAfterEnv": ["@testing-library/jest-native/extend-expect"],
     "moduleFileExtensions": [
       "ts",
       "tsx",
@@ -97,6 +103,12 @@
     ],
     "transformIgnorePatterns": [
       "node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|rollbar-react-native|@fortawesome|@react-native|@react-navigation)"
+    ],
+    "coveragePathIgnorePatterns": [
+      "<rootDir>/node_modules/",
+      "<rootDir>/src/platform",
+      "<rootDir>/src/third-party",
+      "<rootDir>/__tests__/test-utils.js"
     ]
   },
   "browserslist": {