Browse Source

build(js): Add "jest-staged" yarn test to run tests related to staged files only (#8087)

Billy Vong 7 years ago
parent
commit
8cb2474cb2
1 changed files with 3 additions and 4 deletions
  1. 3 4
      package.json

+ 3 - 4
package.json

@@ -93,10 +93,9 @@
   "proxyURL": "http://localhost:8000",
   "scripts": {
     "test": "node scripts/test.js",
-    "test-ci": "npm run test -- --runInBand --ci --coverage --testResultsProcessor=jest-junit",
-    "test-watch": "npm run test -- --watch",
-    "jest": "node scripts/test.js",
-    "jest-debug": "node --inspect-brk scripts/test.js --runInBand",
+    "test-ci": "yarn test --runInBand --ci --coverage --testResultsProcessor=jest-junit",
+    "test-debug": "node --inspect-brk scripts/test.js --runInBand",
+    "test-staged": "yarn test --findRelatedTests $(git diff --name-only --cached)",
     "lint": "node_modules/.bin/eslint tests/js src/sentry/static/sentry/app --ext .js,.jsx",
     "dev-proxy": "node scripts/devproxy.js",
     "dev-server": "webpack-dev-server",