Skip to content

Commit

Permalink
Add test to prevent publishing with incorrect version number.
Browse files Browse the repository at this point in the history
To prevent repeat of bookshelf#918.
  • Loading branch information
rhys-vdw committed Sep 20, 2015
1 parent 61f8050 commit 04b5359
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ git add -u
npm run build
git add -A build

npm test

# Update version in package.json before running tests (tests will catch if the
# version number is out of sync).
update_version 'package.json' $next_version

npm test

git commit -am "release $next_version"
git tag $next_version

Expand Down
12 changes: 12 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ global.AssertionError = chai.AssertionError;
global.Assertion = chai.Assertion;
global.assert = chai.assert;

describe('Bookshelf', function () {

it('VERSION should equal version number in package.json',
function () {
var Knex = require('knex');
var bookshelf = Bookshelf(Knex({}));
var p = require('../package.json');
expect(p.version).to.equal(bookshelf.VERSION);
});

});

// Unit test all of the abstract base interfaces
describe('Unit Tests', function () {

Expand Down

0 comments on commit 04b5359

Please sign in to comment.