From b999948f2c38f5d002fa0dc535429a80acdf2d75 Mon Sep 17 00:00:00 2001 From: Johnny Estilles Date: Tue, 21 Apr 2015 17:55:44 +0800 Subject: [PATCH] test(writeChangelog): updated test to reflect changes to method --- test/git_changelog_generate.spec.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/git_changelog_generate.spec.js b/test/git_changelog_generate.spec.js index ce604d8..9107618 100644 --- a/test/git_changelog_generate.spec.js +++ b/test/git_changelog_generate.spec.js @@ -401,9 +401,12 @@ describe('git_changelog_generate.js', function() { describe('without breaking commits', function() { - before(function() { + before(function(done) { this.stream = { - write: sinon.stub() + write: sinon.stub(), + on: sinon.spy(function(event, callback) { + callback(); + }) }; this.commits = require('./fixtures/commits.js').withoutBreaking; @@ -412,7 +415,9 @@ describe('git_changelog_generate.js', function() { sinon.stub(changelog, 'printSection'); changelog.initOptions({ app_name: 'app', version: 'version' }); - changelog.writeChangelog(this.stream, this.commits); + changelog.writeChangelog(this.stream, this.commits).then(function() { + done(); + }); }); after(function() { @@ -458,9 +463,12 @@ describe('git_changelog_generate.js', function() { describe('with breaking commits', function() { - before(function() { + before(function(done) { this.stream = { - write: sinon.stub() + write: sinon.stub(), + on: sinon.spy(function(event, callback) { + callback(); + }) }; this.commits = require('./fixtures/commits.js').withBreaking; @@ -471,7 +479,9 @@ describe('git_changelog_generate.js', function() { sinon.stub(changelog, 'printSection'); changelog.initOptions({ app_name: 'app', version: 'version' }); - changelog.writeChangelog(this.stream, this.commits); + changelog.writeChangelog(this.stream, this.commits).then(function() { + done(); + }); }); after(function() {