Skip to content

Commit

Permalink
Add one test instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizunashi Mana committed Oct 4, 2016
1 parent cb5000d commit 594b402
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
matrix:
- GITBOOK_VERSION=2.6.7
- GITBOOK_VERSION=3.2.2
before_script:
install:
- npm install
- npm install gitbook@$GITBOOK_VERSION
script:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"gulp": "^3.9.1",
"istanbul": "^0.4.5",
"mocha": "^3.1.0",
"sinon": "^1.17.6"
"sinon": "^1.17.6",
"sinon-chai": "^2.8.0"
},
"peerDependencies": {
"gitbook": ">=2.5.0"
Expand Down
10 changes: 10 additions & 0 deletions test/helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

var chai = require('chai');

var sinonChai = require('sinon-chai');
chai.use(sinonChai);

module.exports = {
expect: chai.expect
};
15 changes: 15 additions & 0 deletions test/isNullable.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
'use strict';

var expect = require('./helper').expect;

var gulpGitbook = require('..');
var isNullable = gulpGitbook._private.isNullable;

describe('isNullable', function () {

it('should be ok for nullable values', function () {
expect(isNullable(null)).to.be.true;
expect(isNullable(undefined)).to.be.true;
expect(isNullable(false)).to.be.false;
expect(isNullable(0)).to.be.false;
expect(isNullable('')).to.be.false;
expect(isNullable({})).to.be.false;
expect(isNullable(true)).to.be.false;
});

});

0 comments on commit 594b402

Please sign in to comment.