Skip to content

Commit

Permalink
Replace should.ifError(err) with should.not.exist(err).
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAlbin committed Aug 6, 2015
1 parent 01b590d commit dd0b2d0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
17 changes: 9 additions & 8 deletions test/test_cli.js
Expand Up @@ -24,7 +24,7 @@ describe('Command Line Interface', function() {
before(function(done) {
var self = this;
exec('bin/kss-node', function(err, stdout, stderr) {
should.ifError(err);
should.not.exist(err);
self.stdout = stdout;
self.stderr = stderr;
done();
Expand All @@ -44,7 +44,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --verbose --source ' + source + ' --destination test/output/nested',
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
stdout.should.containEql('* KSS Source : ' + source);
stdout.should.containEql(successMessage);
done();
Expand All @@ -57,6 +57,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --verbose --source ' + source + ' --destination test/output/nested',
function(err, stdout) {
should.exist(err);
err.should.be.Error();
stdout.should.containEql('* KSS Source : ' + source);
stdout.should.containEql('No KSS documentation discovered in source files.');
Expand All @@ -71,7 +72,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --source ' + testUtils.fixtures('missing-homepage') + ' --destination test/output/nested',
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
stdout.should.containEql(noHomepageWarning);
stdout.should.containEql(successMessage);
done();
Expand All @@ -85,7 +86,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --verbose --source ' + source + ' --source ' + source2 + ' --destination test/output/nested',
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
stdout.should.containEql('* KSS Source : ' + source + ', ' + source2);
stdout.should.containEql(successMessage);
done();
Expand All @@ -101,7 +102,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --verbose ' + source + ' --destination ' + destination,
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
stdout.should.containEql('* Destination : ' + destination);
done();
}
Expand All @@ -114,9 +115,9 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node test/fixtures/with-include test/output/nested --template test/fixtures/template --custom custom --custom custom2',
function(err) {
should.ifError(err);
should.not.exist(err);
fs.readFile(path.join(__dirname, 'output/nested/section-4.html'), 'utf8', function(err2, data) {
should.ifError(err2);
should.not.exist(err2);
data.should.containEql('"custom" property: This is the first custom property.');
data.should.containEql('"custom2" property: This is the second custom property.');
done();
Expand All @@ -131,7 +132,7 @@ describe('Command Line Interface', function() {
exec(
'bin/kss-node --config test/fixtures/cli-option-config.json',
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
stdout.should.containEql(successMessage);
done();
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_cli_handlebars.js
Expand Up @@ -20,7 +20,7 @@ describe('Handlebars template', function() {
exec(
'bin/kss-node test/fixtures/with-include test/output/nested --template test/fixtures/template --helpers test/fixtures/template/helpers',
function(err, stdout) {
should.ifError(err);
should.not.exist(err);
self.stdout = stdout;
files = [
'index',
Expand Down
4 changes: 2 additions & 2 deletions test/test_parse.js
Expand Up @@ -205,7 +205,7 @@ describe('kss.parse()', function() {

it('should do something, not sure what', function(done) {
kss.parse(this.files, {}, function(err, styleguide) {
should.ifError(err);
should.not.exist(err);
styleguide.section('all-by-itself').header().should.be.a.String().and.not.be.empty();
});
done();
Expand Down Expand Up @@ -383,7 +383,7 @@ describe('kss.parse()', function() {
describe('.weight', function() {
it('should correct an invalid weight', function(done) {
kss.parse(this.files, {}, function(err, styleguide) {
should.ifError(err);
should.not.exist(err);
styleguide.section('invalid-weight').weight().should.be.a.Number().and.equal(0);
});
done();
Expand Down

0 comments on commit dd0b2d0

Please sign in to comment.