Skip to content

Commit

Permalink
Fix a few negated conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 9, 2018
1 parent cebebe7 commit 0cb7056
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions test/deep-base.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ describe('deep-base', () => {

it('copies source files relative to the base', done => {
fs.exists(path.join(repo, 'hello.txt'), exists => {
if (!exists) {
done(new Error('Failed to find "hello.txt" in repo: ') + repo);
} else {
if (exists) {
done();
} else {
done(new Error('Failed to find "hello.txt" in repo: ') + repo);
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions test/different-repo.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ describe('different-repo', () => {

it('copies source files', done => {
fs.exists(path.join(repo, 'hello.txt'), exists => {
if (!exists) {
done(new Error('Failed to find "hello.txt" in repo: ') + repo);
} else {
if (exists) {
done();
} else {
done(new Error('Failed to find "hello.txt" in repo: ') + repo);
}
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/dotfiles-option.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@ describe('dotfiles-option', () => {

it('copies files with dots', done => {
fs.exists(path.join(repo, '.one'), exists => {
if (!exists) {
done(new Error('Failed to find ".one" in repo: ') + repo);
} else {
if (exists) {
done();
} else {
done(new Error('Failed to find ".one" in repo: ') + repo);
}
});
});

it('copies files in directories with dots', done => {
fs.exists(path.join(repo, 'foo', '.bar', 'two'), exists => {
if (!exists) {
done(new Error('Failed to find "foo/.bar/two" in repo: ') + repo);
} else {
if (exists) {
done();
} else {
done(new Error('Failed to find "foo/.bar/two" in repo: ') + repo);
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions test/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ const tmpDir = 'tmp';
* @param {function(Error, Process)} done Callback.
*/
function spawnGrunt(dir, done) {
if (!fs.existsSync(path.join(dir, 'Gruntfile.js'))) {
done(new Error(`Cannot find Gruntfile.js in dir: ${dir}`));
} else {
if (fs.existsSync(path.join(dir, 'Gruntfile.js'))) {
const node = process.argv[0];
const grunt = process.argv[1]; // assumes grunt drives these tests
const child = cp.spawn(node, [grunt, '--verbose'], {cwd: dir});
done(null, child);
} else {
done(new Error(`Cannot find Gruntfile.js in dir: ${dir}`));
}
}

Expand Down

0 comments on commit 0cb7056

Please sign in to comment.