Fixed broken tests

This commit is contained in:
Angelos Chalaris
2018-10-31 19:29:49 +02:00
parent 0e58603310
commit 93b875a259
2 changed files with 52 additions and 2 deletions

View File

@ -19,8 +19,10 @@ test('Returns the longest array', () => {
test('Returns the longest object when comparing arrays and strings', () => {
expect(longestItem([1, 2, 3], 'foobar')).toEqual('foobar');
});
test('Returns undefined without any input', () => {
expect(longestItem()).toEqual(undefined);
test('Returns TypeError without any input', () => {
expect(() => {
longestItem();
}).toThrow(TypeError);
});
test('Returns first found of all similar', () => {
expect(longestItem('a', 'b', 'c')).toEqual('a');