Skip to content

Commit

Permalink
Merge 7f3fe8f into 9928aae
Browse files Browse the repository at this point in the history
  • Loading branch information
segayuu committed Oct 26, 2018
2 parents 9928aae + 7f3fe8f commit 2dc3b46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"jscs": "^2.6.0",
"jscs-preset-hexo": "^1.0.1",
"mocha": "^2.3.4",
"sinon": "^1.17.3",
"sinon": "^7.0.0",
"supertest": "^1.2.0",
"supertest-promised": "^1.0.0",
"uuid": "^2.0.1"
Expand Down
10 changes: 6 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,23 +233,25 @@ describe('server', function() {

it('display localhost instead of 0.0.0.0', function() {
var spy = sinon.spy();
sinon.stub(hexo.log, 'info', spy);
var stub = sinon.stub(hexo.log, 'info');
stub.callsFake(spy);

return Promise.using(prepareServer(), function(app) {
spy.args[1][1].should.contain('localhost');
}).finally(function() {
hexo.log.info.restore();
stub.restore();
});
});

it('display localhost instead of [::]', function() {
var spy = sinon.spy();
sinon.stub(hexo.log, 'info', spy);
var stub = sinon.stub(hexo.log, 'info');
stub.callsFake(spy);

return Promise.using(prepareServer({ip: '::'}), function(app) {
spy.args[1][1].should.contain('localhost');
}).finally(function() {
hexo.log.info.restore();
stub.restore();
});
});
});

0 comments on commit 2dc3b46

Please sign in to comment.