-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathintegrationTests.js
70 lines (54 loc) · 1.75 KB
/
integrationTests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*jshint expr: true*/
var spawn = require('child_process').spawn;
require('should');
var logOutput = '';
function runNodemon(target, done) {
var nodemonProcess = spawn('grunt', ['nodemon:' + target]);
nodemonProcess.stdout.setEncoding('utf8');
nodemonProcess.stdout.on('data', function (data) {
logOutput += data;
if (data.match(/Server/)) {
nodemonProcess.kill();
done();
}
});
}
describe('grunt-nodemon', function () {
describe('when run with all options specified', function () {
before(function (done) {
runNodemon('all', done);
});
it('should set arguments to the app correctly', function() {
logOutput.should.containEql('production');
});
it('should set node arguments correctly', function() {
logOutput.should.containEql('debug');
});
it('should set the ignored files correctly', function() {
logOutput.should.containEql('README.md');
});
it('should set the watched extensions correctly', function() {
logOutput.should.containEql('tasks');
});
it('should set the delay time correctly', function() {
logOutput.should.containEql('1000');
});
it('should set the legacy watch correctly', function() {
logOutput.should.containEql('legacyWatch: true');
});
it('should set environment variables correctly', function() {
logOutput.should.containEql('Port: 8181');
});
it('should set the callback correctly', function() {
logOutput.should.containEql('custom logging');
});
});
describe('when run with no options specified', function () {
before(function (done) {
runNodemon('none', done);
});
it('should log nodemon output', function() {
logOutput.should.containEql('debug');
});
});
});