diff --git a/package.json b/package.json index b7545c2ef3..3edac89636 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": "nyc mocha --ui tdd -- test/unitTests/**/*.test.ts", + "test:unit": "nyc -r lcovonly --report-dir coverage/unit 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,9 +40,11 @@ "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/*.json && cd ..", - "cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/*.json", - "cov:report": "npm run cov:merge && codecov" + "cov:merge": "cd ./out && istanbul-combine -d ../coverage/integration -r lcovonly ../.nyc_output/integration/*.json && cd ..", + "cov:merge-html": "istanbul-combine -d ./coverage -r html ./.nyc_output/integration/*.json", + "cov:report": "npm-run-all cov:report:integration cov:report:unit", + "cov:report:unit": "codecov -f \"coverage/unit/lcov.info\" -F unit", + "cov:report:integration": "npm run cov:merge && codecov -f \"coverage/integration/lcov.info\" -F integration" }, "nyc": { "include": [ diff --git a/test/coverageWritingTestRunner.ts b/test/coverageWritingTestRunner.ts index 2f5d84d853..a4f139657b 100644 --- a/test/coverageWritingTestRunner.ts +++ b/test/coverageWritingTestRunner.ts @@ -46,7 +46,7 @@ export default class CoverageWritingTestRunner { private async writeCoverage(): Promise { if (typeof __coverage__ !== 'undefined') { - let nycFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, ".nyc_output"); + let nycFolderPath = path.join(process.env.CODE_EXTENSIONS_PATH, ".nyc_output", "integration"); if (!(await fs.exists(nycFolderPath))) { await fs.mkdir(nycFolderPath); @@ -63,9 +63,9 @@ export default class CoverageWritingTestRunner { 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; - if (nodePath) { - nodePath = `${nodePath}${path.delimiter}`; + nodePath = ""; + if (process.env.NVM_BIN) { + nodePath = `${process.env.NVM_BIN}${path.sep}`; } await fs.writeTextFile(rawCoverageJsonPath, JSON.stringify(__coverage__)); diff --git a/test/featureTests/index.ts b/test/featureTests/index.ts index 9b5ad6600f..5eec1b9ba2 100644 --- a/test/featureTests/index.ts +++ b/test/featureTests/index.ts @@ -23,7 +23,7 @@ let testRunner = new coverageWritingTestRunner(require('vscode/lib/testrunner')) // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info testRunner.configure({ - timeout: 10000, + timeout: 100000, ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.) useColors: true // colored output from test results });