Linted tests

This commit is contained in:
Angelos Chalaris
2018-09-15 12:52:15 +03:00
parent 0c8f3b3c94
commit 3887161332
4 changed files with 6 additions and 7 deletions

View File

@ -36,4 +36,3 @@ test('Falsy trues', () => {
test('Falsy falses', () => { test('Falsy falses', () => {
expect(allEqual([false, false, true])).toBeFalsy(); expect(allEqual([false, false, true])).toBeFalsy();
}); });

View File

@ -6,7 +6,7 @@ test('deepFreeze is a Function', () => {
}); });
test('modifying deeply freezed object prop throws an error in strict mode', () => { test('modifying deeply freezed object prop throws an error in strict mode', () => {
let freezedObj = deepFreeze({a: 42}); let freezedObj = deepFreeze({ a: 42 });
expect(() => { expect(() => {
'use strict'; 'use strict';

View File

@ -8,8 +8,8 @@ test('Initializes an array containing the numbers in the specified range (witout
expect(initializeArrayWithRange(5)).toEqual([0, 1, 2, 3, 4, 5]); expect(initializeArrayWithRange(5)).toEqual([0, 1, 2, 3, 4, 5]);
}); });
test('Initializes an array containing the numbers in the specified range', () => { test('Initializes an array containing the numbers in the specified range', () => {
expect(initializeArrayWithRange(7,3)).toEqual([3, 4, 5, 6, 7]); expect(initializeArrayWithRange(7, 3)).toEqual([3, 4, 5, 6, 7]);
}); });
test('Initializes an array containing the numbers in the specified range (with step)', () => { test('Initializes an array containing the numbers in the specified range (with step)', () => {
expect(initializeArrayWithRange(9,0,2)).toEqual([0, 2, 4, 6, 8]); expect(initializeArrayWithRange(9, 0, 2)).toEqual([0, 2, 4, 6, 8]);
}); });

View File

@ -11,7 +11,7 @@ test('Returns the longest object from a spread array', () => {
expect(longestItem(...['a', 'ab', 'abc'])).toEqual('abc'); expect(longestItem(...['a', 'ab', 'abc'])).toEqual('abc');
}); });
test('Returns the longest object from mixed input', () => { test('Returns the longest object from mixed input', () => {
expect(longestItem(...['a', 'ab', 'abc'],'abcd')).toEqual('abcd'); expect(longestItem(...['a', 'ab', 'abc'], 'abcd')).toEqual('abcd');
}); });
test('Returns the longest array', () => { test('Returns the longest array', () => {
expect(longestItem([1, 2, 3], [1, 2], [1, 2, 3, 4, 5])).toEqual([1, 2, 3, 4, 5]); expect(longestItem([1, 2, 3], [1, 2], [1, 2, 3, 4, 5])).toEqual([1, 2, 3, 4, 5]);
@ -23,10 +23,10 @@ test('Returns undefined without any input', () => {
expect(longestItem()).toEqual(undefined); expect(longestItem()).toEqual(undefined);
}); });
test('Returns first found of all similar', () => { test('Returns first found of all similar', () => {
expect(longestItem('a','b','c')).toEqual('a'); expect(longestItem('a', 'b', 'c')).toEqual('a');
}); });
test('Throws TypeError if all inputs are undefined', () => { test('Throws TypeError if all inputs are undefined', () => {
expect(() => { expect(() => {
longestItem(undefined,undefined); longestItem(undefined, undefined);
}).toThrow(TypeError); }).toThrow(TypeError);
}); });