Эх сурвалжийг харах

HUE-9090 [frontend] Enable js test coverage gathering

Run with "npm run test-coverage"
Johan Ahlen 6 жил өмнө
parent
commit
95444a6540
3 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 1 0
      .gitignore
  2. 2 1
      jest.config.js
  3. 1 0
      package.json

+ 1 - 0
.gitignore

@@ -56,6 +56,7 @@ desktop/core/ext-py/lxml/src/lxml/lxml-version.h
 # Coverage product
 /.coverage
 /coverage.xml
+/coverage
 
 # Common utility alias
 /d

+ 2 - 1
jest.config.js

@@ -6,5 +6,6 @@ module.exports = {
   testEnvironment: 'jest-environment-jsdom-fourteen',
   testURL: 'https://www.gethue.com/hue',
   setupFilesAfterEnv: ['<rootDir>/desktop/core/src/desktop/js/jest/jest.init.js'],
-  watchPathIgnorePatterns: ['<rootDir>/desktop/core/src/desktop/static']
+  watchPathIgnorePatterns: ['<rootDir>/desktop/core/src/desktop/static'],
+  collectCoverageFrom: ['<rootDir>/desktop/core/src/desktop/js/**/*.{js,jsx}']
 };

+ 1 - 0
package.json

@@ -108,6 +108,7 @@
     "lint-debug": "npm run lint -- --debug",
     "lint-fix": "npm run lint -- --fix",
     "test": "jest",
+    "test-coverage": "jest --coverage",
     "test-dev": "jest --watch"
   },
   "files": []