add 2 tests orderBy and palindrome

This commit is contained in:
Stefan Feješ
2018-01-10 14:24:45 +01:00
parent c38c4688e7
commit ab34685926
2 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,9 @@ test('Testing orderBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof orderBy === 'function', 'orderBy is a Function');
const users = [{ name: 'fred', age: 48 }, { name: 'barney', age: 36 }, { name: 'fred', age: 40 }];
t.deepEqual(orderBy(users, ['name', 'age'], ['asc', 'desc']), [{name: 'barney', age: 36}, {name: 'fred', age: 48}, {name: 'fred', age: 40}], "Returns a sorted array of objects ordered by properties and orders.");
t.deepEqual(orderBy(users, ['name', 'age']), [{name: 'barney', age: 36}, {name: 'fred', age: 40}, {name: 'fred', age: 48}], "Returns a sorted array of objects ordered by properties and orders.");
//t.deepEqual(orderBy(args..), 'Expected');
//t.equal(orderBy(args..), 'Expected');
//t.false(orderBy(args..), 'Expected');

View File

@ -5,6 +5,8 @@ test('Testing palindrome', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof palindrome === 'function', 'palindrome is a Function');
t.equal(palindrome('taco cat'), true, "Given string is a palindrome");
t.equal(palindrome('foobar'), false, "Given string is not a palindrome");
//t.deepEqual(palindrome(args..), 'Expected');
//t.equal(palindrome(args..), 'Expected');
//t.false(palindrome(args..), 'Expected');