Skip to content

Commit

Permalink
[FormRecognizer] Enable code coverage (Azure#8557)
Browse files Browse the repository at this point in the history
for both NodeJs and browser
  • Loading branch information
jeremymeng authored May 1, 2020
1 parent 27b642d commit 26065ac
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
19 changes: 19 additions & 0 deletions sdk/formrecognizer/ai-form-recognizer/.nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"include": [
"dist-esm/src/**/*.js"
],
"exclude": [
"**/*.d.ts",
"dist-esm/src/utils/utils.browser.js",
"dist-esm/src/generated/src/**/*.js"
],
"reporter": [
"text-summary",
"html",
"cobertura"
],
"exclude-after-remap":false,
"sourceMap": true,
"instrument": true,
"all": true
}
4 changes: 2 additions & 2 deletions sdk/formrecognizer/ai-form-recognizer/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ module.exports = function(config) {
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
"**/*.js": ["env"],
"recordings/browsers/**/*.json": ["json"]
"recordings/browsers/**/*.json": ["json"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
// "test-browser/index.js": ["coverage"]
"dist-test/index.browser.js": ["coverage"]
},

envPreprocessor: [
Expand Down
3 changes: 2 additions & 1 deletion sdk/formrecognizer/ai-form-recognizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "karma start --single-run",
"integration-test:node": "mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js",
"integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --full-trace -t 300000 dist-esm/test/*.spec.js dist-esm/test/node/*.spec.js",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json tsconfig.json api-extractor.json src test --ext .ts -f html -o formrecognizer-lintReport.html || exit 0",
Expand Down Expand Up @@ -127,6 +127,7 @@
"karma-remap-istanbul": "^0.6.0",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^1.18.0",
"nyc": "^14.0.0",
"prettier": "^1.16.4",
"rimraf": "^3.0.0",
"rollup": "^1.16.3",
Expand Down

0 comments on commit 26065ac

Please sign in to comment.