mocha-typescript
Advanced tools
Comparing version 1.0.12 to 1.0.14
@@ -6,2 +6,37 @@ #!/usr/bin/env node | ||
var chalk = require("chalk"); | ||
var yargs = require("yargs"); | ||
var argv = yargs | ||
.options({ | ||
"p": { | ||
alias: "project", | ||
demand: false, | ||
default: ".", | ||
describe: "Path to tsconfig file or directory containing tsconfig, passed to `tsc -p <value>`.", | ||
type: "string" | ||
}, | ||
"t": { | ||
alias: "tsc", | ||
demand: false, | ||
default: "./node_modules/typescript/bin/tsc", | ||
describe: "Path to executable tsc, by default points to typescript installed as dev dependency. Set to 'tsc' for global tsc installation.", | ||
type: "string" | ||
}, | ||
"o": { | ||
alias: "opts", | ||
demand: false, | ||
default: "./test/mocha.opts", | ||
describe: "Path to mocha.opts file containing additional mocha configuration.", | ||
type: "string" | ||
}, | ||
"m": { | ||
alias: "mocha", | ||
demand: false, | ||
default: "./node_modules/mocha/bin/_mocha", | ||
describe: "Path to executable mocha, by default points to mocha installed as dev dependency.", | ||
type: "string" | ||
} | ||
}) | ||
.help("h") | ||
.alias("h", "help") | ||
.argv; | ||
var mocha = null; | ||
@@ -12,3 +47,3 @@ var mochal = null; | ||
if (mocha) { | ||
mocha.kill('SIGINT'); | ||
mocha.kill("SIGINT"); | ||
} | ||
@@ -30,4 +65,4 @@ mocha = null; | ||
} | ||
mocha = spawn("node", ["./node_modules/mocha/bin/_mocha", "--colors"]); | ||
mocha.on('close', code => { | ||
mocha = spawn("node", [argv.mocha, "--opts", argv.opts, "--colors"]); | ||
mocha.on("close", code => { | ||
if (code) { | ||
@@ -42,9 +77,9 @@ console.log(chalk.red("Exited with " + code)); | ||
mochal = readline.createInterface({ input: mocha.stdout }); | ||
mochal.on('line', line => { | ||
mochal.on("line", line => { | ||
console.log(line); | ||
}); | ||
} | ||
var tsc = spawn("node", ["./node_modules/typescript/bin/tsc", "--watch"]); | ||
var tsc = spawn("node", [argv.tsc, "-p", argv.project, "-w"]); | ||
var tscl = readline.createInterface({ input: tsc.stdout }); | ||
tscl.on('line', line => { | ||
tscl.on("line", line => { | ||
console.log(line); | ||
@@ -51,0 +86,0 @@ if (line.indexOf("Compilation complete.") >= 0) { |
{ | ||
"name": "mocha-typescript", | ||
"version": "1.0.12", | ||
"version": "1.0.14", | ||
"description": "TypeScript decorators based wrapper over mocha's interface", | ||
@@ -22,3 +22,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"chalk": "^1.1.3" | ||
"chalk": "^1.1.3", | ||
"yargs": "^6.5.0" | ||
}, | ||
@@ -25,0 +26,0 @@ "devDependencies": { |
@@ -38,2 +38,27 @@ # TypeScript Decorators Based Interface for Mocha | ||
The `mocha-typescript-watch` script is designed as a command line tool. | ||
You can provide the arguments in the package.json's script, for example: | ||
``` | ||
"scripts": { | ||
"dev-test-watch": "mocha-typescript-watch -p tsconfig.test.json -o mocha.opts" | ||
}, | ||
``` | ||
For complete list with check `./node_modules/.bin/mocha-typescript-watch --help`: | ||
``` | ||
Options: | ||
-p, --project Path to tsconfig file or directory containing tsconfig, passed | ||
to `tsc -p <value>`. [string] [default: "."] | ||
-t, --tsc Path to executable tsc, by default points to typescript | ||
installed as dev dependency. Set to 'tsc' for global tsc | ||
installation. | ||
[string] [default: "./node_modules/typescript/bin/tsc"] | ||
-o, --opts Path to mocha.opts file containing additional mocha | ||
configuration. [string] [default: "./test/mocha.opts"] | ||
-m, --mocha Path to executable mocha, by default points to mocha installed | ||
as dev dependency. | ||
[string] [default: "./node_modules/mocha/bin/_mocha"] | ||
-h, --help Show help [boolean] | ||
``` | ||
# Test Interface | ||
@@ -40,0 +65,0 @@ The standard mocha interface (arrow functions are discouraged because this is messed up, so we use function): |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33318
329
397
2
+ Addedyargs@^6.5.0
+ Addedcamelcase@3.0.0(transitive)
+ Addedcliui@3.2.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-caller-file@1.0.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedinvert-kv@1.0.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedlcid@1.0.0(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedos-locale@1.4.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@1.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedwhich-module@1.0.0(transitive)
+ Addedwrap-ansi@2.1.0(transitive)
+ Addedy18n@3.2.2(transitive)
+ Addedyargs@6.6.0(transitive)
+ Addedyargs-parser@4.2.1(transitive)