Test files linted

This commit is contained in:
Angelos Chalaris
2018-08-03 10:39:26 +03:00
parent 5ef1fab5fd
commit cc7b76d0b3
153 changed files with 754 additions and 463 deletions

View File

@ -6,27 +6,35 @@ test('uniqueElementsByRight is a Function', () => {
});
test('uniqueElementsByRight works for properties', () => {
expect(uniqueElementsByRight(
[
{ id: 0, value: 'a' },
{ id: 1, value: 'b' },
{ id: 2, value: 'c' },
{ id: 1, value: 'd' },
{ id: 0, value: 'e' },
],
(a, b) => a.id === b.id
)).toEqual([ { id: 0, value: 'e' }, { id: 1, value: 'd' }, { id: 2, value: 'c' } ]);
expect(
uniqueElementsByRight(
[
{ id: 0, value: 'a' },
{ id: 1, value: 'b' },
{ id: 2, value: 'c' },
{ id: 1, value: 'd' },
{ id: 0, value: 'e' }
],
(a, b) => a.id === b.id
)
).toEqual([{ id: 0, value: 'e' }, { id: 1, value: 'd' }, { id: 2, value: 'c' }]);
});
test('uniqueElementsByRight works for nested properties', () => {
expect(uniqueElementsByRight(
[
{ id: 0, value: 'a', n: {p: 0} },
{ id: 1, value: 'b', n: {p: 1} },
{ id: 2, value: 'c', n: {p: 2} },
{ id: 1, value: 'd', n: {p: 0} },
{ id: 0, value: 'e', n: {p: 1} },
],
(a, b) => a.id === b.id
)).toEqual([ { id: 0, value: 'e', n: {p: 1} }, { id: 1, value: 'd', n: {p: 0} }, { id: 2, value: 'c', n: {p: 2} } ]);
expect(
uniqueElementsByRight(
[
{ id: 0, value: 'a', n: { p: 0 } },
{ id: 1, value: 'b', n: { p: 1 } },
{ id: 2, value: 'c', n: { p: 2 } },
{ id: 1, value: 'd', n: { p: 0 } },
{ id: 0, value: 'e', n: { p: 1 } }
],
(a, b) => a.id === b.id
)
).toEqual([
{ id: 0, value: 'e', n: { p: 1 } },
{ id: 1, value: 'd', n: { p: 0 } },
{ id: 2, value: 'c', n: { p: 2 } }
]);
});