Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FormRecognizer] Enable code coverage #8557

Merged
merged 1 commit into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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