update zipObject test, type, omit, truthy, throw error, and more

This commit is contained in:
King
2018-01-17 09:40:50 -05:00
parent 3e1bebb48b
commit 54a6631356

View File

@ -5,10 +5,15 @@ test('Testing zipObject', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof zipObject === 'function', 'zipObject is a Function');
t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'Array was zipped to object');
t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'Array was zipped to object');
//t.equal(zipObject(args..), 'Expected');
//t.false(zipObject(args..), 'Expected');
//t.throws(zipObject(args..), 'Expected');
t.deepEqual(zipObject(['a', 'b', 'c'], [1, 2]), {a: 1, b: 2, c: undefined}, 'zipObject([a, b, c], [1, 2]) returns {a: 1, b: 2, c: undefined}');
t.deepEqual(zipObject(['a', 'b'], [1, 2, 3]), {a: 1, b: 2}, 'zipObject([a, b], [1, 2, 3]) returns {a: 1, b: 2}');
t.deepEqual(zipObject(['a', 'b', 'c'], 'string'), { a: 's', b: 't', c: 'r' }, 'zipObject([a, b, c], string) returns { a: s, b: t, c: r }');
t.deepEqual(zipObject(['a'], 'string'), { a: 's' }, 'zipObject([a], string) returns { a: s }');
t.throws(() => zipObject(), 'zipObject() throws an error');
t.throws(() => zipObject(['string'], null), 'zipObject([string], null) throws an error');
t.throws(() => zipObject(null, [1]), 'zipObject(null, [1]) throws an error');
t.throws(() => zipObject('string'), 'zipObject(string) throws an error');
t.throws(() => zipObject('test', 'string'), 'zipObject(test, string) throws an error');
t.end();
});