]> cat aescling's git repositories - mastodon.git/commitdiff
Enable coverage for Jest (#5442)
authorYamagishi Kazutoshi <ykzts@desire.sh>
Wed, 18 Oct 2017 09:39:36 +0000 (18:39 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 18 Oct 2017 09:39:36 +0000 (11:39 +0200)
jest.config.js
package.json

index dd9dadf87666c6ce7b9362abb1178c62ffa6057d..50bde57e65fbb252f3ed1b021dbbd9bc6ea9fee0 100644 (file)
@@ -14,4 +14,12 @@ module.exports = {
     'raf/polyfill',
   ],
   setupTestFrameworkScriptFile: '<rootDir>/app/javascript/mastodon/test_setup.js',
+  collectCoverageFrom: [
+    'app/javascript/mastodon/**/*.js',
+    '!app/javascript/mastodon/features/emoji/emoji_compressed.js',
+    '!app/javascript/mastodon/locales/locale-data/*.js',
+    '!app/javascript/mastodon/service_worker/entry.js',
+    '!app/javascript/mastodon/test_setup.js',
+  ],
+  coverageDirectory: '<rootDir>/coverage',
 };
index e398730c495cd70bd965696551ebde2bab787e79..594e42475b09b36f632f32464f6feb610bc8ff1c 100644 (file)
@@ -9,7 +9,7 @@
     "start": "node ./streaming/index.js",
     "test": "npm run test:lint && npm run test:jest",
     "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ spec/javascript/ streaming/",
-    "test:jest": "cross-env NODE_ENV=test jest",
+    "test:jest": "cross-env NODE_ENV=test jest --coverage",
     "postinstall": "npm rebuild node-sass"
   },
   "repository": {