diff --git a/package.json b/package.json index 8c8710fa2..b67d4f66b 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/test/coverageWritingTestRunner.ts b/test/coverageWritingTestRunner.ts index 36f159ffc..2f5d84d85 100644 --- a/test/coverageWritingTestRunner.ts +++ b/test/coverageWritingTestRunner.ts @@ -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;