Skip to content

Commit

Permalink
Merge pull request #399 from SockDrawer/fix-tests-unhandled-promises
Browse files Browse the repository at this point in the history
Chores: Cleanup build/test warnings
  • Loading branch information
AccaliaDeElementia authored Dec 14, 2016
2 parents c06ef05 + f7c6a67 commit 6a29d6e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion providers/nodebb/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ exports.bindNotification = function bindNotification(forum) {
* @private
*
* @param {*} notification Notification we are parsing
* @returns {Promise} Rejects with "Ignoring notification" if we do not process this. Resolves with the notification otherwise.
* @returns {Promise} Rejects with "Ignoring notification" if we do not process this. Resolves with the notification
* otherwise.
*/
function evalBlacklist(notification) {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion test/lib/utilsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('lib/utils', () => {
});
it('should reject when iteration function rejects', () => {
const spy = sinon.stub().rejects('bad');
return utils.iterate([0], spy).should.eventually.reject;
return utils.iterate([0], spy).should.be.rejectedWith('bad');
});
});
describe('parseJSON()', () => {
Expand Down
6 changes: 4 additions & 2 deletions test/providers/nodebb/formatTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,14 +565,16 @@ describe('providers/nodebb/format', () => {
[
undefined, null, false, '', 0, NaN, []
].forEach((input) => {
const expected = '<details>\n<summary>\nSPOILER!\n</summary>\n\nthey were dead all along\n\n</details>';
const expected = '<details>\n<summary>\nSPOILER!\n</summary>\n\nthey were dead all along\n\n' +
'</details>';
it(`should provide sensible output for input: ${input}`, () => {
const actual = testModule.spoiler('they were dead all along', input);
actual.should.equal(expected);
});
});
[
['Summer Glau', '<details>\n<summary>\nSummer Glau\n</summary>\n\nthey were dead all along\n\n</details>'],
['Summer Glau', '<details>\n<summary>\nSummer Glau\n</summary>\n\nthey were dead all along\n\n' +
'</details>'],
[4, '<details>\n<summary>\n4\n</summary>\n\nthey were dead all along\n\n</details>'],
[3.1415, '<details>\n<summary>\n3.1415\n</summary>\n\nthey were dead all along\n\n</details>'],
[true, '<details>\n<summary>\ntrue\n</summary>\n\nthey were dead all along\n\n</details>'],
Expand Down
2 changes: 1 addition & 1 deletion test/providers/nodebb/indexTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ describe('providers/nodebb', () => {
});
it('should reject on bad JSON response', () => {
request.get.yields(null, null, '{"foo":"bar');
return forum._getConfig().should.reject;
return forum._getConfig().should.be.rejectedWith('Unexpected end of');
});
});
describe('login()', () => {
Expand Down

0 comments on commit 6a29d6e

Please sign in to comment.