Skip to content
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
10 changes: 6 additions & 4 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": "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",
Expand All @@ -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": [
Expand Down
8 changes: 4 additions & 4 deletions test/coverageWritingTestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class CoverageWritingTestRunner {

private async writeCoverage(): Promise<void> {
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);
Expand All @@ -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__));
Expand Down
2 changes: 1 addition & 1 deletion test/featureTests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
Expand Down