Skip to content

Commit

Permalink
test(mssql): remove unhandled rejection tests (#14006)
Browse files Browse the repository at this point in the history
Co-authored-by: Zoé <zoe@ephys.dev>
  • Loading branch information
WikiRik and ephys committed Jan 25, 2022
1 parent 3f75880 commit a86272c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions test/integration/dialects/mssql/query-queue.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,27 +98,5 @@ if (dialect.startsWith('mssql')) {

await expect(promise).not.to.be.rejected;
});

describe('unhandled rejections', () => {
it('unhandled rejection should occur if user doesn\'t catch promise returned from query', async function () {
const User = this.User;
const rejectionPromise = Support.nextUnhandledRejection();
User.create({
username: new Date(),
});
await expect(rejectionPromise).to.be.rejectedWith(
Sequelize.ValidationError, 'string violation: username cannot be an array or an object',
);
});

it('no unhandled rejections should occur as long as user catches promise returned from query', async function () {
const User = this.User;
const unhandledRejections = Support.captureUnhandledRejections();
await expect(User.create({
username: new Date(),
})).to.be.rejectedWith(Sequelize.ValidationError);
expect(unhandledRejections).to.deep.equal([]);
});
});
});
}

0 comments on commit a86272c

Please sign in to comment.