From 69204832c82d20511eb0b5b67bc726798d700555 Mon Sep 17 00:00:00 2001 From: Sterling Camden Date: Fri, 13 Mar 2015 10:44:23 -0700 Subject: [PATCH] add basic test for preid --- test/index.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/index.js b/test/index.js index b5490ee..9a3aad6 100644 --- a/test/index.js +++ b/test/index.js @@ -116,4 +116,22 @@ describe('gulp-bump: JSON comparison fixtures', function() { bumpS.write(fakeFile); bumpS.end(); }); + + it('should bump to a prerelease version with a preid', function(done) { + var fakeFile = new gutil.File({ + contents: new Buffer('{ "version": "0.0.1"}'), + path: 'test/fixtures/test.json' + }); + + var bumpS = bump({type: 'prerelease', preid : 'alphaWhateverTheYWant'}); + + bumpS.once('data', function(newFile) { + should.exist(newFile); + should.exist(newFile.contents); + JSON.parse(newFile.contents.toString()).version.should.equal('0.0.2-alphaWhateverTheYWant.0'); + return done(); + }); + bumpS.write(fakeFile); + bumpS.end(); + }); });