mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
Fixing tests
- Make scripts output expected content (rather than the bash user!) - Reduce noise - Ensure the exec it quoted appropriately
This commit is contained in:
2
test/fixtures/some file
vendored
2
test/fixtures/some file
vendored
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
console.log(process.env.USER || 'OK');
|
||||
console.log('OK');
|
||||
2
test/fixtures/some"file
vendored
2
test/fixtures/some"file
vendored
@@ -1,2 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
console.log(process.env.USER || 'OK');
|
||||
console.log('OK');
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('nodemon fork', function () {
|
||||
done(new Error(data));
|
||||
},
|
||||
output: function (data) {
|
||||
process.stdout.write(data);
|
||||
// process.stdout.write(data);
|
||||
if (data.trim() === 'OK') {
|
||||
found = true;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ it('should start a fork exec with quotes and escaping', function (done) {
|
||||
done(new Error(data));
|
||||
},
|
||||
output: function (data) {
|
||||
process.stdout.write(data);
|
||||
// process.stdout.write(data);
|
||||
if (data.trim() === 'OK') {
|
||||
found = true;
|
||||
}
|
||||
@@ -87,14 +87,14 @@ it('should start a fork exec with spaces and slashes', function (done) {
|
||||
var p = run({
|
||||
exec: 'bin/nodemon.js',
|
||||
// make nodemon verbose so we can check the filters being applied
|
||||
args: ['-q', '--exec', 'test/fixtures/some\ \\file']
|
||||
args: ['-q', '--exec', '"test/fixtures/some\ \\file"']
|
||||
}, {
|
||||
error: function (data) {
|
||||
p.send('quit');
|
||||
done(new Error(data));
|
||||
},
|
||||
output: function (data) {
|
||||
process.stdout.write(data);
|
||||
// process.stdout.write(data);
|
||||
if (data.trim() === 'OK') {
|
||||
found = true;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ it('should start a fork exec with spaces and slashes', function (done) {
|
||||
done(new Error(data));
|
||||
},
|
||||
output: function (data) {
|
||||
process.stdout.write(data);
|
||||
// process.stdout.write(data);
|
||||
if (data.trim() === 'foo') {
|
||||
found = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user