Skip to content

Commit

Permalink
add test for --link CLI flag; issue #248
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasmalik committed Nov 5, 2016
1 parent 49c76f0 commit a5b01f8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/bin/cmd.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ test('cli exits with code 1 when there are errors', function (t) {
t.end();
});
});

test('cli creates a symlink file when called with "--link"', function (t) {
exec('./bin/cmd.js ./test/bin --link', function (err, stdout, stderr) {
t.notOk(err, 'Expect no errors thrown');
t.notOk(stderr, 'Expect nothing logged to stderr');
t.ok(
/Successfully symlinked .eslintrc.js to /.test(stdout),
'Expect success message in stdout'
);

utils.deleteFile(path.join(__dirname, '.eslintrc.js'));
t.end();
});
});

0 comments on commit a5b01f8

Please sign in to comment.