Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe('Sum of numbers inside an array', () => {
- it('If input is an array of strings', () => {
- let actual = func(['1', '2', '3']);
- let expected = 6;
- expect(actual).to.be.equal(expected);
- });
- it('If input is an array of negative numbers', () => {
- let actual = func([-1, -2, -3]);
- let expected = -6;
- expect(actual).to.be.equal(expected);
- });
- it('If input is an array of strings including something that cant be converted', () => {
- assert.equal(Number.isNaN(func(['1', '2', '3', 'Tosho'])), true);
- });
- it('If array length is 0', () => {
- let actual = func([]);
- let expected = 0;
- expect(actual).to.be.equal(expected);
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment