tsc-watch
Advanced tools
Comparing version 2.1.0 to 2.1.1
setInterval(() => console.log(Math.random()), 1000); |
setInterval(() => console.log(Math.random()), 1000); |
@@ -0,0 +0,0 @@ function removeRunnerArgs(args) { |
@@ -0,0 +0,0 @@ const { fork } = require('child_process'); |
@@ -25,10 +25,3 @@ const psTree = require('ps-tree'); | ||
psTree(child.pid, function(err, kids) { | ||
spawn( | ||
'kill', | ||
['-s', KILL_SIGNAL, child.pid].concat( | ||
kids.map(function(p) { | ||
return p.PID; | ||
}), | ||
), | ||
).on('close', resolve); | ||
spawn('kill', ['-s', KILL_SIGNAL, child.pid].concat( kids.map(function(p) { return p.PID; }) )).on('close', resolve); | ||
}); | ||
@@ -35,0 +28,0 @@ } else { |
const spawn = require('cross-spawn'); | ||
const stringArgv = require('string-argv'); | ||
const killer = require('./killer'); | ||
@@ -4,0 +5,0 @@ function runCommand(fullCommand) { |
@@ -0,0 +0,0 @@ const stripAnsi = require('strip-ansi'); |
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
{ | ||
"name": "tsc-watch", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "The TypeScript compiler with onSuccess command", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -0,0 +0,0 @@ [![Build Status](https://travis-ci.com/gilamran/tsc-watch.svg?branch=master)](https://travis-ci.com/gilamran/tsc-watch) |
@@ -0,0 +0,0 @@ const { expect } = require('chai'); |
const { expect } = require('chai'); | ||
const sinon = require('sinon'); | ||
const mochaEventually = require('mocha-eventually'); | ||
const eventually = fn => mochaEventually(fn, 4000, 10); | ||
const eventually = fn => mochaEventually(fn, 8000, 50); | ||
const TscWatchClient = require('../lib/client'); | ||
@@ -9,36 +9,34 @@ const { driver: tscWatchDriver } = require('./driver.js'); | ||
describe('Client Events', () => { | ||
before(() => { | ||
this.successSourcePath = './tmp/fixtures/passing.ts'; | ||
this.failSourcePath = './tmp/fixtures/failing.ts'; | ||
}); | ||
let watchClient; | ||
let callback; | ||
beforeEach(() => { | ||
this.watchClient = new TscWatchClient(); | ||
this.callback = sinon.stub(); | ||
watchClient = new TscWatchClient(); | ||
callback = sinon.stub(); | ||
}); | ||
afterEach(() => this.watchClient.kill()); | ||
afterEach(() => watchClient.kill()); | ||
describe('Events', () => { | ||
it('Should emit "first_success" on first success', () => { | ||
this.watchClient.on('first_success', this.callback); | ||
this.watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/passing.ts'); | ||
watchClient.on('first_success', callback); | ||
watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/passing.ts'); | ||
return eventually(() => expect(this.callback.calledOnce).to.be.true); | ||
return eventually(() => expect(callback.calledOnce).to.be.true); | ||
}); | ||
it('Should fire "subsequent_success" on subsequent successes', () => { | ||
this.watchClient.on('subsequent_success', this.callback); | ||
this.watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/passing.ts'); | ||
watchClient.on('subsequent_success', callback); | ||
watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/passing.ts'); | ||
tscWatchDriver.modifyAndSucceedAfter(1500); | ||
return eventually(() => expect(this.callback.calledOnce).to.be.true); | ||
return eventually(() => expect(callback.calledOnce).to.be.true); | ||
}); | ||
it('Should fire "compile_errors" on when tsc compile errors occur', () => { | ||
this.watchClient.on('compile_errors', this.callback); | ||
this.watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/failing.ts'); | ||
watchClient.on('compile_errors', callback); | ||
watchClient.start('--noClear', '--out', './tmp/output.js', './tmp/fixtures/failing.ts'); | ||
return eventually(() => expect(this.callback.calledOnce).to.be.true); | ||
return eventually(() => expect(callback.calledOnce).to.be.true); | ||
}); | ||
}); | ||
}); |
@@ -0,0 +0,0 @@ const { fork } = require('child_process'); |
@@ -0,0 +0,0 @@ const { expect } = require('chai'); |
Sorry, the diff of this file is not supported yet
24300
453