diff --git a/jest.config.js b/jest.config.js index dd9dadf87666c6ce7b9362abb1178c62ffa6057d..50bde57e65fbb252f3ed1b021dbbd9bc6ea9fee0 100644 --- a/jest.config.js +++ b/jest.config.js @@ -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', }; diff --git a/package.json b/package.json index e398730c495cd70bd965696551ebde2bab787e79..594e42475b09b36f632f32464f6feb610bc8ff1c 100644 --- a/package.json +++ b/package.json @@ -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": {