-
Notifications
You must be signed in to change notification settings - Fork 22
Add tests for Queue #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
let queue = new Queue(data.n); | ||
queue.push(...data.test); | ||
|
||
expect(queue.queue).to.be.equal(data.result); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- no assertions in the loop
- looks like overkill
}); | ||
}); | ||
|
||
it('should add more values, then queue max size', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be should not add?
queue.push(...data.test); | ||
|
||
expect(queue.queue, 'should be reduced to queue max size').to.be.equal(data.result); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same issue as tests above
let queue = new Queue(0); | ||
queue.push(1, 2, 3); | ||
|
||
expect(queue.queue).to.be.an('error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bad way of error handling
|
||
expect(queue.pop(data.n)).to.be.equal(data.result); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above
queue.queue = [...data.test]; | ||
|
||
expect(queue.pop(data.n)).to.be.equal(data.result); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above
queue.queue = [...data.test]; | ||
|
||
expect(queue.top()).to.be.equal(data.result); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above
queue3 = [...data.queue1, ...data.queue2]; | ||
|
||
expect(queue1.merge(queue1, false)).to.be.equal(queue3); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same as above
expect(queue1.merge(queue1, false)).to.be.equal(queue3); | ||
}); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most of the tests are testing the same logic several times that is not needed, while some functionality is not covered.
No description provided.