mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
+3
-14
@@ -25,26 +25,15 @@ jobs:
|
||||
displayName: Cache node modules
|
||||
- script: yarn --frozen-lockfile
|
||||
displayName: 'Install dependencies and build'
|
||||
- script: yarn test-unit --forbid-only
|
||||
- script: yarn test-coverage --forbid-only
|
||||
displayName: 'Unit tests'
|
||||
- script: yarn lint
|
||||
displayName: 'Lint'
|
||||
- script: |
|
||||
NODE_PATH=$(pwd)/out ./node_modules/.bin/nyc ./node_modules/.bin/mocha './out/*test.js' './out/**/*test.js'
|
||||
./node_modules/.bin/nyc report --reporter=cobertura
|
||||
displayName: 'Coverage report'
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
|
||||
displayName: 'Publish coverage'
|
||||
- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@6
|
||||
displayName: 'Check build quality'
|
||||
inputs:
|
||||
checkCoverage: true
|
||||
coverageType: lines
|
||||
coverageThreshold: 60
|
||||
coverageFailOption: fixed
|
||||
|
||||
- job: macOS
|
||||
pool:
|
||||
@@ -63,7 +52,7 @@ jobs:
|
||||
displayName: Cache node modules
|
||||
- script: yarn --frozen-lockfile
|
||||
displayName: 'Install dependencies and build'
|
||||
- script: yarn test-unit --forbid-only
|
||||
- script: yarn test-coverage --forbid-only
|
||||
displayName: 'Unit tests'
|
||||
- script: yarn lint
|
||||
displayName: 'Lint'
|
||||
@@ -85,7 +74,7 @@ jobs:
|
||||
displayName: Cache node modules
|
||||
- script: yarn --frozen-lockfile
|
||||
displayName: 'Install dependencies and build'
|
||||
- script: yarn test-unit --forbid-only
|
||||
- script: yarn test-coverage --forbid-only
|
||||
displayName: 'Unit tests'
|
||||
- script: yarn lint
|
||||
displayName: 'Lint'
|
||||
|
||||
+20
-1
@@ -28,6 +28,26 @@ if (process.argv.length > 2) {
|
||||
}
|
||||
}
|
||||
|
||||
const checkCoverage = flagArgs.indexOf('--coverage') >= 0;
|
||||
|
||||
if (checkCoverage) {
|
||||
flagArgs.splice(flagArgs.indexOf('--coverage'), 1);
|
||||
const executable = path.resolve(__dirname, '../node_modules/.bin/nyc');
|
||||
const args = ['--check-coverage', '--lines=100', path.resolve(__dirname, '../node_modules/.bin/mocha'), ...testFiles, ...flagArgs];
|
||||
console.info('executable', executable);
|
||||
console.info('args', args);
|
||||
const run = cp.spawnSync(
|
||||
executable,
|
||||
args,
|
||||
{
|
||||
cwd: path.resolve(__dirname, '..'),
|
||||
env,
|
||||
stdio: 'inherit'
|
||||
}
|
||||
);
|
||||
process.exit(run.status);
|
||||
}
|
||||
|
||||
const run = cp.spawnSync(
|
||||
path.resolve(__dirname, '../node_modules/.bin/mocha'),
|
||||
[...testFiles, ...flagArgs],
|
||||
@@ -37,5 +57,4 @@ const run = cp.spawnSync(
|
||||
stdio: 'inherit'
|
||||
}
|
||||
);
|
||||
|
||||
process.exit(run.status);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"posttest": "npm run lint",
|
||||
"test-api": "mocha \"**/*.api.js\"",
|
||||
"test-unit": "node ./bin/test.js",
|
||||
"test-coverage": "node ./bin/test.js --coverage",
|
||||
"build": "tsc -b ./tsconfig.all.json",
|
||||
"prepare": "npm run setup",
|
||||
"setup": "npm run build",
|
||||
|
||||
Reference in New Issue
Block a user