Skip to content

Commit

Permalink
style: fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Jan 23, 2024
1 parent 9ccfea6 commit 0e1fb4e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ function formatAddress(ip, port, root) {
hostname = 'localhost';
}

let path = root.startsWith("/") ? root : `/${root}`;
const path = root.startsWith('/') ? root : `/${root}`;
return new URL(`http://${hostname}:${port}${path}`).toString();
}
18 changes: 9 additions & 9 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('server', () => {
});

it('logger', () => {
hexo.config.server.log = true
hexo.config.server.log = true;
const spy = sinon.spy();
const stub = sinon.stub(morgan, 'format');
stub.callsFake(spy);
Expand All @@ -302,8 +302,8 @@ describe('server', () => {
return request(app).get('/bar/baz');
}).finally(() => {
spy.called.should.be.true;
hexo.config.server.log = false
})
hexo.config.server.log = false;
});
});
});

Expand All @@ -322,29 +322,29 @@ describe('server', () => {
hexo.config.feed = {
path: 'bar/baz.html',
type: 'atom'
}
};
return Promise.using(prepareServer(), app => {
return request(app).get('/bar/baz.html').expect('Content-Type', 'application/atom+xml');
})
});
});

it('feed - rss', () => {
hexo.config.feed = {
path: 'bar/baz.html',
type: 'rss'
}
};
return Promise.using(prepareServer(), app => {
return request(app).get('/bar/baz.html').expect('Content-Type', 'application/rss+xml');
})
});
});

it('feed - other', () => {
hexo.config.feed = {
path: 'bar/baz.html',
type: ''
}
};
return Promise.using(prepareServer(), app => {
return request(app).get('/bar/baz.html').expect('Content-Type', 'text/html');
})
});
});
});

0 comments on commit 0e1fb4e

Please sign in to comment.