Remove launch.json in favor of auto attach debugging
This commit is contained in:
Vendored
-23
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Mocha Tests",
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha",
|
|
||||||
"windows": {
|
|
||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha.cmd"
|
|
||||||
},
|
|
||||||
"runtimeArgs": [
|
|
||||||
"--colors",
|
|
||||||
"--recursive",
|
|
||||||
"${workspaceRoot}/lib"
|
|
||||||
],
|
|
||||||
"sourceMaps": true,
|
|
||||||
"outFiles": [ "${workspaceRoot}/lib/**/*.js" ],
|
|
||||||
"internalConsoleOptions": "openOnSessionStart"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
+17
-10
@@ -25,6 +25,13 @@ let outDir = tsProject.config.compilerOptions.outDir;
|
|||||||
|
|
||||||
const addons = fs.readdirSync(`${__dirname}/src/addons`);
|
const addons = fs.readdirSync(`${__dirname}/src/addons`);
|
||||||
|
|
||||||
|
const TEST_PATHS = [
|
||||||
|
`${outDir}/*test.js`,
|
||||||
|
`${outDir}/**/*test.js`,
|
||||||
|
`${outDir}/*integration.js`,
|
||||||
|
`${outDir}/**/*integration.js`
|
||||||
|
];
|
||||||
|
|
||||||
// Under some environments like TravisCI, this comes out at absolute which can
|
// Under some environments like TravisCI, this comes out at absolute which can
|
||||||
// break the build. This ensures that the outDir is absolute.
|
// break the build. This ensures that the outDir is absolute.
|
||||||
if (path.normalize(outDir).indexOf(__dirname) !== 0) {
|
if (path.normalize(outDir).indexOf(__dirname) !== 0) {
|
||||||
@@ -142,13 +149,14 @@ gulp.task('instrument-test', function () {
|
|||||||
.pipe(istanbul.hookRequire());
|
.pipe(istanbul.hookRequire());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('mocha', ['instrument-test'], function () {
|
gulp.task('mocha', function () {
|
||||||
return gulp.src([
|
return gulp.src(TEST_PATHS, {read: false})
|
||||||
`${outDir}/*test.js`,
|
.pipe(mocha())
|
||||||
`${outDir}/**/*test.js`,
|
.once('error', () => process.exit(1));
|
||||||
`${outDir}/*integration.js`,
|
});
|
||||||
`${outDir}/**/*integration.js`
|
|
||||||
], {read: false})
|
gulp.task('mocha-coverage', ['instrument-test'], function () {
|
||||||
|
return gulp.src(TEST_PATHS, {read: false})
|
||||||
.pipe(mocha())
|
.pipe(mocha())
|
||||||
.once('error', () => process.exit(1))
|
.once('error', () => process.exit(1))
|
||||||
.pipe(istanbul.writeReports());
|
.pipe(istanbul.writeReports());
|
||||||
@@ -158,13 +166,12 @@ gulp.task('mocha', ['instrument-test'], function () {
|
|||||||
* Run single test file by file name(without file extension). Example of the command:
|
* Run single test file by file name(without file extension). Example of the command:
|
||||||
* gulp mocha-test --test InputHandler.test
|
* gulp mocha-test --test InputHandler.test
|
||||||
*/
|
*/
|
||||||
gulp.task('mocha-test', ['instrument-test'], function () {
|
gulp.task('mocha-test', [], function () {
|
||||||
let testName = util.env.test;
|
let testName = util.env.test;
|
||||||
util.log("Run test by Name: " + testName);
|
util.log("Run test by Name: " + testName);
|
||||||
return gulp.src([`${outDir}/${testName}.js`, `${outDir}/**/${testName}.js`], {read: false})
|
return gulp.src([`${outDir}/${testName}.js`, `${outDir}/**/${testName}.js`], {read: false})
|
||||||
.pipe(mocha())
|
.pipe(mocha())
|
||||||
.once('error', () => process.exit(1))
|
.once('error', () => process.exit(1));
|
||||||
.pipe(istanbul.writeReports());
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -79,11 +79,13 @@
|
|||||||
"start-zmodem": "node demo/zmodem/app",
|
"start-zmodem": "node demo/zmodem/app",
|
||||||
"lint": "tslint src/*.ts src/**/*.ts",
|
"lint": "tslint src/*.ts src/**/*.ts",
|
||||||
"test": "npm-run-all mocha lint",
|
"test": "npm-run-all mocha lint",
|
||||||
|
"test-debug": "node --inspect-brk node_modules/.bin/gulp test",
|
||||||
"mocha": "gulp test",
|
"mocha": "gulp test",
|
||||||
"build:docs": "jsdoc -c jsdoc.json",
|
"build:docs": "jsdoc -c jsdoc.json",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
|
"coverage": "gulp mocha-coverage",
|
||||||
"coveralls": "gulp coveralls",
|
"coveralls": "gulp coveralls",
|
||||||
"webpack": "gulp webpack",
|
"webpack": "gulp webpack",
|
||||||
"watch": "gulp watch"
|
"watch": "gulp watch"
|
||||||
|
|||||||
Reference in New Issue
Block a user