Update test descriptions

This commit is contained in:
Josh Johnson 2019-11-28 21:19:25 +00:00
parent 9be164e2e5
commit a57eb3e689

View file

@ -1148,8 +1148,8 @@ describe('choices', () => {
instance.initialised = false; instance.initialised = false;
}); });
it('should throw', () => { it('throws a ReferenceError', () => {
expect(() => instance.setChoices(null)).Throw(ReferenceError); expect(() => instance.setChoices(null)).to.throw(ReferenceError);
}); });
}); });
@ -1158,8 +1158,8 @@ describe('choices', () => {
instance._isSelectElement = false; instance._isSelectElement = false;
}); });
it('should throw', () => { it('throws a TypeError', () => {
expect(() => instance.setChoices(null)).Throw(TypeError); expect(() => instance.setChoices([])).to.throw(TypeError);
}); });
}); });
@ -1168,15 +1168,22 @@ describe('choices', () => {
instance._isSelectElement = true; instance._isSelectElement = true;
}); });
it('should throw on non function', () => { describe('passing a non-function', () => {
expect(() => instance.setChoices(null)).Throw(TypeError, /Promise/i); it('throws a TypeError', () => {
expect(() => instance.setChoices(null)).to.throw(
TypeError,
/Promise/i,
);
});
}); });
it(`should throw on function that doesn't return promise`, () => { describe('passing a function that does not return a promise', () => {
expect(() => instance.setChoices(() => 'boo')).to.throw( it('throws a TypeError', () => {
TypeError, expect(() => instance.setChoices(() => 'boo')).to.throw(
/promise/i, TypeError,
); /promise/i,
);
});
}); });
}); });