Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ environment:
- nodejs_version: "6"

install:
- npm -g install npm@latest
- set PATH=%APPDATA%\npm;%PATH%
- ps: Install-Product node $env:nodejs_version
- npm install

Expand Down
11 changes: 8 additions & 3 deletions test/completion.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ describe('flag: --completion', function() {
.gulp('--completion=' + type)
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toNotExist();
expect(stderr).toEqual('');
expect(stdout).toEqual(expected);
done(err);
}
Expand All @@ -31,8 +33,9 @@ describe('flag: --completion', function() {
.gulp('--completion=unknown')
.run(cb);

function cb(err, stdout) {
expect(err).toExist();
function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toExist, why did you change to toNotEqual(null)?

expect(stderr).toEqual('');
expect(stdout).toEqual(expected);
done();
}
Expand All @@ -44,7 +47,9 @@ describe('flag: --completion', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toExist, why did you change to toNotEqual(null)?

expect(stderr).toMatch('Missing completion type');
expect(stdout).toEqual('');
done();
}
});
Expand Down
12 changes: 9 additions & 3 deletions test/config-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ describe('config: description', function() {
.gulp('--tasks')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var expected = fs.readFileSync(path.join(expectedDir, 'output0.txt'),
'utf-8');
stdout = eraseTime(stdout);
Expand All @@ -36,7 +38,9 @@ describe('config: description', function() {
.gulp('--tasks')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var expected = fs.readFileSync(path.join(expectedDir, 'output0.txt'),
'utf-8');
stdout = eraseTime(skipLines(stdout, 1));
Expand All @@ -52,7 +56,9 @@ describe('config: description', function() {
.gulp('--tasks', '--gulpfile ../foo/bar/gulpfile.js', '--cwd .')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var expected = fs.readFileSync(path.join(expectedDir, 'output1.txt'),
'utf-8');
stdout = eraseTime(stdout);
Expand Down
12 changes: 8 additions & 4 deletions test/config-flags-gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ describe('config: flags.gulpfile', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = headLines(stdout, 2, 2);
expect(stdout).toEqual(
'This gulpfile : ' +
path.join(fixturesDir, 'flags/gulpfile/is/here/mygulpfile.js') +
'\n' +
'The current directory : ' + path.join(fixturesDir, 'flags/gulpfile')
);
expect(stderr).toEqual('');
done(err);
}
});
Expand All @@ -36,14 +37,15 @@ describe('config: flags.gulpfile', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = headLines(stdout, 2, 3);
expect(stdout).toEqual(
'This gulpfile : ' +
path.join(fixturesDir, 'flags/gulpfile/is/here/mygulpfile.js') +
'\n' +
'The current directory : ' + path.join(fixturesDir, 'flags/gulpfile')
);
expect(stderr).toEqual('');
done(err);
}
});
Expand All @@ -56,12 +58,13 @@ describe('config: flags.gulpfile', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = headLines(stdout, 1, 3);
expect(stdout).toEqual(
'Another gulpfile : ' +
path.join(fixturesDir, 'flags/gulpfile/cwd/gulpfile.js')
);
expect(stderr).toEqual('');
done(err);
}
});
Expand All @@ -74,12 +77,13 @@ describe('config: flags.gulpfile', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = headLines(stdout, 1, 3);
expect(stdout).toEqual(
'Another gulpfile : ' +
path.join(fixturesDir, 'flags/gulpfile/cwd/gulpfile.js')
);
expect(stderr).toEqual('');
done(err);
}
});
Expand Down
6 changes: 4 additions & 2 deletions test/config-flags-silent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ describe('config: flags.silent', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(stdout).toEqual('');
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
expect(stdout).toEqual('');
done(err);
}
});
Expand All @@ -33,13 +34,14 @@ describe('config: flags.silent', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = eraseLapse(eraseTime(skipLines(stdout, 1)));
expect(stdout).toEqual(
'Starting \'default\'...\n' +
'Finished \'default\' after ?\n' +
''
);
expect(stderr).toEqual('');
done(err);
}
});
Expand Down
3 changes: 2 additions & 1 deletion test/exports-as-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ describe('exports as tasks', function() {
'--gulpfile ./test/fixtures/gulpfiles/gulpfile-exports.babel.js')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err not tested?

var filepath = path.join(expectedDir, 'tasks-as-exports.txt');
var expected = fs.readFileSync(filepath, 'utf-8');
expect(stderr).toEqual('');
stdout = eraseTime(skipLines(stdout, 2));
expect(stdout).toEqual(expected);
done();
Expand Down
2 changes: 0 additions & 2 deletions test/flags-continue.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('flag: --continue', function() {

function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);

stdout = eraseLapse(eraseTime(skipLines(stdout, 2)));
expect(stdout).toEqual(
'Starting \'test4\'...\n' +
Expand All @@ -42,7 +41,6 @@ describe('flag: --continue', function() {

function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);

expect(stdout).toNotMatch('Starting \'anon\'');
stdout = eraseLapse(eraseTime(skipLines(stdout, 2)));
expect(stdout).toEqual(
Expand Down
5 changes: 4 additions & 1 deletion test/flags-gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ describe('flag: --gulpfile', function() {
.gulp('--gulpfile', gulpfilePath)
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');

var chgWorkdirLog = headLines(stdout, 1);
var workdir = path.dirname(gulpfilePath).replace(/\//g, path.sep);
expect(chgWorkdirLog).toMatch('Working directory changed to ');
Expand Down
8 changes: 6 additions & 2 deletions test/flags-help.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ describe('flag: --help', function() {
.gulp('--help', '--cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = eraseFirstSpace(stdout);
expect(stdout).toEqual(outputText);
done(err);
Expand All @@ -33,7 +35,9 @@ describe('flag: --help', function() {
.gulp('--h', '--cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = eraseFirstSpace(stdout);
expect(stdout).toEqual(outputText);
done(err);
Expand Down
7 changes: 6 additions & 1 deletion test/flags-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('flag: --require', function() {
.gulp('--require ../test-module.js', '--cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var insideLog = headLines(stdout, 1);
expect(insideLog).toEqual('inside test module');

Expand Down Expand Up @@ -54,6 +56,9 @@ describe('flag: --require', function() {
.run(cb);

function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

stderr = eraseLapse(eraseTime(stderr));
expect(stderr).toMatch('Failed to load external module ./null-module.js');
expect(stdout).toNotMatch('inside test module');
expect(stdout).toNotMatch(
'Requiring external module ../test-module.js');
Expand Down
4 changes: 3 additions & 1 deletion test/flags-silent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ describe('flag: --silent', function() {
.gulp('--silent', '--cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
expect(stdout).toEqual('');
done(err);
}
Expand Down
10 changes: 8 additions & 2 deletions test/flags-tasks-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('flag: --tasks-json', function() {
.gulp('--tasks-json --gulpfile ./test/fixtures/gulpfiles/gulpfile.js')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = skipLines(stdout, 1);
expect(JSON.parse(stdout)).toEqual(expected);
done();
Expand All @@ -33,7 +35,11 @@ describe('flag: --tasks-json', function() {
'--gulpfile ./test/fixtures/gulpfiles/gulpfile.js')
.run(cb);

function cb(err) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = skipLines(stdout, 1);
expect(stdout).toEqual('');
var file = fs.readFileSync(__dirname + '/output/tasks.json', 'utf8');
var parsedJson = JSON.parse(file);
expect(parsedJson).toEqual(expected);
Expand Down
4 changes: 3 additions & 1 deletion test/flags-tasks-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ describe('flag: --tasks-simple', function() {
.gulp('--tasks-simple', '--cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
expect(stdout).toEqual(outputText);
done(err);
}
Expand Down
12 changes: 9 additions & 3 deletions test/flags-tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ describe('flag: --tasks', function() {
.gulp('--tasks --cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var filepath = path.join(expectedDir, 'flags-tasks.txt');
var expected = fs.readFileSync(filepath, 'utf-8');
stdout = eraseTime(skipLines(stdout, 1));
Expand All @@ -32,7 +34,9 @@ describe('flag: --tasks', function() {
'--cwd ./test/fixtures')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var filepath = path.join(expectedDir, 'with-desc-and-flags.txt');
var expected = fs.readFileSync(filepath, 'utf-8');
stdout = eraseTime(skipLines(stdout, 1));
Expand All @@ -49,7 +53,9 @@ describe('flag: --tasks', function() {
'--cwd ./test/fixtures')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
var filepath = path.join(expectedDir, 'by-unwrap-and-not-by-unwrap.txt');
var expected = fs.readFileSync(filepath, 'utf-8');
stdout = eraseTime(skipLines(stdout, 1));
Expand Down
12 changes: 7 additions & 5 deletions test/flags-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ describe('flag: --verify', function() {
.gulp('--verify invalid-package.json', '--cwd ./test/fixtures/packages/')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);

expect(stderr).toEqual('');
stdout = eraseTime(stdout);
expect(stdout).toEqual(
'Verifying plugins in ' +
Expand All @@ -33,7 +33,9 @@ describe('flag: --verify', function() {
.gulp('--verify valid-package.json', '--cwd ./test/fixtures/packages/')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toEqual(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer toNotExist, why did you choose to use toEqual(null)?

expect(stderr).toEqual('');
stdout = eraseTime(stdout);
expect(stdout).toEqual(
'Verifying plugins in ' +
Expand All @@ -51,9 +53,9 @@ describe('flag: --verify', function() {
.gulp('--verify', '--cwd ./test/fixtures/packages/')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
expect(err).toNotEqual(null);

expect(stderr).toEqual('');
stdout = eraseTime(stdout);
expect(stdout).toEqual(
'Verifying plugins in ' +
Expand Down
3 changes: 2 additions & 1 deletion test/flags-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe('flag: --version', function() {
.gulp('--version --cwd ./test/fixtures/gulpfiles')
.run(cb);

function cb(err, stdout) {
function cb(err, stdout, stderr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err still not tested?

expect(stderr).toEqual('');
stdout = eraseTime(stdout);
expect(stdout).toEqual(
'CLI version ' + cliVersion + '\n' +
Expand Down
Loading