Final fixes, all tests running

This commit is contained in:
Angelos Chalaris
2018-06-18 20:41:57 +03:00
parent 977adb1198
commit e9594e6355
49 changed files with 2189 additions and 1198 deletions

View File

@ -7,7 +7,7 @@ test('union is a Function', () => {
test('union([1, 2, 3], [4, 3, 2]) returns [1, 2, 3, 4]', () => {
expect(union([1, 2, 3], [4, 3, 2])).toEqual([1, 2, 3, 4]);
});
test('union('str', 'asd') returns [ 's', 't', 'r', 'a', 'd' ]', () => {
test('union(\'str\', \'asd\') returns [ \'s\', \'t\', \'r\', \'a\', \'d\' ]', () => {
expect(union('str', 'asd')).toEqual([ 's', 't', 'r', 'a', 'd' ]);
});
test('union([[], {}], [1, 2, 3]) returns [[], {}, 1, 2, 3]', () => {
@ -17,22 +17,22 @@ test('union([], []) returns []', () => {
expect(union([], [])).toEqual([]);
});
test('union() throws an error', () => {
expect(union()).toThrow();
expect(() => {union(); }).toThrow();
});
test('union(true, \'str\') throws an error', () => {
expect(union(true, 'str')).toThrow();
expect(() => {union(true, 'str'); }).toThrow();
});
test('union(\'false\', true) throws an error', () => {
expect(union('false', true)).toThrow();
expect(() => {union('false', true); }).toThrow();
});
test('union((123, {}) throws an error', () => {
expect(union((123, {})).toThrow();
expect(() => {union(123, {}); }).toThrow();
});
test('union([], {}) throws an error', () => {
expect(union([], {})).toThrow();
expect(() => {union([], {}); }).toThrow();
});
test('union(undefined, null) throws an error', () => {
expect(union(undefined, null)).toThrow();
expect(() => {union(undefined, null); }).toThrow();
});
let start = new Date().getTime();
union([1, 2, 3], [4, 3, 2]);