mirror of
https://github.com/status-im/github-comment-manager.git
synced 2025-02-19 20:58:09 +00:00
use the rejectedWith check in comments tests too
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
a42f78b710
commit
db52b7d776
@ -56,11 +56,7 @@ describe('Comments', () => {
|
||||
describe('renderComment', () => {
|
||||
it('should fail with no builds', async () => {
|
||||
builds.getBuilds.returns([])
|
||||
try {
|
||||
await comments.renderComment('PR-ID')
|
||||
} catch(err) {
|
||||
expect(err.message).to.eq('No builds exist for this PR')
|
||||
}
|
||||
expect(comments.renderComment('PR-ID')).rejectedWith('No builds exist for this PR')
|
||||
})
|
||||
|
||||
it('should render correctly', async () => {
|
||||
|
@ -29,12 +29,12 @@ describe('Schema', () => {
|
||||
|
||||
it('can\'t be a null', () => {
|
||||
build.commit = null
|
||||
expect(Joi.validate(build, Schema)).to.be.rejectedWith('"commit" must be a string')
|
||||
expect(Joi.validate(build, Schema)).rejectedWith('"commit" must be a string')
|
||||
})
|
||||
|
||||
it('can\'t be a number', async () => {
|
||||
build.commit = 1
|
||||
expect(Joi.validate(build, Schema)).to.be.rejectedWith('"commit" must be a string')
|
||||
expect(Joi.validate(build, Schema)).rejectedWith('"commit" must be a string')
|
||||
})
|
||||
})
|
||||
|
||||
@ -52,7 +52,7 @@ describe('Schema', () => {
|
||||
|
||||
it('can\'t be a number', async () => {
|
||||
build.pkg_url = 1
|
||||
expect(Joi.validate(build, Schema)).to.be.rejectedWith('"pkg_url" must be a string')
|
||||
expect(Joi.validate(build, Schema)).rejectedWith('"pkg_url" must be a string')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user