Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mocha-typescript

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-typescript - npm Package Compare versions

Comparing version 1.0.12 to 1.0.14

47

bin/watch.js

@@ -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) {

5

package.json
{
"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):

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc