mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-29 02:40:19 +02:00
Update test descriptions
This commit is contained in:
parent
9be164e2e5
commit
a57eb3e689
|
@ -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,
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue