Skip to content

Commit

Permalink
enable codecov on unit tests (#2118)
Browse files Browse the repository at this point in the history
* enable codecov on unit tests

* rename coverage files for uniform globbing
  • Loading branch information
Piotr Puszkiewicz authored Mar 16, 2018
1 parent 5d1f202 commit 7cc2291
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
22 changes: 19 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"watch": "tsc -watch -p ./",
"tdd": "npm run test:unit -- --watch --watch-extensions ts",
"test": "npm-run-all test:feature test:unit test:integration",
"test:unit": "mocha --opts mocha.opts",
"test:unit": "nyc mocha --ui tdd -- test/unitTests/**/*.test.ts",
"test:feature": "cross-env OSVC_SUITE=featureTests CODE_EXTENSIONS_PATH=./ CODE_TESTS_PATH=./out/test/featureTests npm run test:runInVsCode",
"test:integration": "npm-run-all test:integration:*",
"test:integration:singleCsproj": "cross-env OSVC_SUITE=singleCsproj npm run test:runSuiteInVsCode",
Expand All @@ -40,10 +40,26 @@
"test:runInVsCode": "node ./test/runVsCodeTestsWithAbsolutePaths.js",
"postinstall": "node ./node_modules/vscode/bin/install",
"cov:instrument": "rimraf ./coverage && rimraf ./.nyc_output && rimraf ./out && npm run compile && cd out && nyc instrument --require source-map-support/register --cwd ../ . . && cd ..",
"cov:merge": "cd ./out && istanbul-combine -d ../coverage -r lcovonly ../.nyc_output/*.remapped.json && cd ..",
"cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/*.remapped.json",
"cov:merge": "cd ./out && istanbul-combine -d ../coverage -r lcovonly ../.nyc_output/*.json && cd ..",
"cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/*.json",
"cov:report": "npm run cov:merge && codecov"
},
"nyc": {
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"extension": [
".ts",
".tsx"
],
"require": [
"ts-node/register",
"source-map-support/register"
],
"sourceMap": true,
"instrument": true
},
"dependencies": {
"fs-extra": "^5.0.0",
"http-proxy-agent": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/coverageWritingTestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export default class CoverageWritingTestRunner {
let nodePath: string;

try {
rawCoverageJsonPath = path.join(nycFolderPath, `${process.env.OSVC_SUITE}.json`);
remappedCoverageJsonPath = path.join(nycFolderPath, `${process.env.OSVC_SUITE}.remapped.json`);
rawCoverageJsonPath = path.join(nycFolderPath, `${process.env.OSVC_SUITE}.json.raw`);
remappedCoverageJsonPath = path.join(nycFolderPath, `${process.env.OSVC_SUITE}.json`);
outFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, "out");
remapIstanbulPath = path.join(process.env.CODE_EXTENSIONS_PATH, "node_modules", "remap-istanbul", "bin", "remap-istanbul.js");
nodePath = process.env.NVM_BIN;
Expand Down

0 comments on commit 7cc2291

Please sign in to comment.