mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-26 09:20:10 +02:00
Update test descriptions
This commit is contained in:
parent
9be164e2e5
commit
a57eb3e689
|
@ -1148,8 +1148,8 @@ describe('choices', () => {
|
|||
instance.initialised = false;
|
||||
});
|
||||
|
||||
it('should throw', () => {
|
||||
expect(() => instance.setChoices(null)).Throw(ReferenceError);
|
||||
it('throws a ReferenceError', () => {
|
||||
expect(() => instance.setChoices(null)).to.throw(ReferenceError);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1158,8 +1158,8 @@ describe('choices', () => {
|
|||
instance._isSelectElement = false;
|
||||
});
|
||||
|
||||
it('should throw', () => {
|
||||
expect(() => instance.setChoices(null)).Throw(TypeError);
|
||||
it('throws a TypeError', () => {
|
||||
expect(() => instance.setChoices([])).to.throw(TypeError);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -1168,15 +1168,22 @@ describe('choices', () => {
|
|||
instance._isSelectElement = true;
|
||||
});
|
||||
|
||||
it('should throw on non function', () => {
|
||||
expect(() => instance.setChoices(null)).Throw(TypeError, /Promise/i);
|
||||
describe('passing a non-function', () => {
|
||||
it('throws a TypeError', () => {
|
||||
expect(() => instance.setChoices(null)).to.throw(
|
||||
TypeError,
|
||||
/Promise/i,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it(`should throw on function that doesn't return promise`, () => {
|
||||
expect(() => instance.setChoices(() => 'boo')).to.throw(
|
||||
TypeError,
|
||||
/promise/i,
|
||||
);
|
||||
describe('passing a function that does not return a promise', () => {
|
||||
it('throws a TypeError', () => {
|
||||
expect(() => instance.setChoices(() => 'boo')).to.throw(
|
||||
TypeError,
|
||||
/promise/i,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue