Bones/node_modules/zip-object/test/index.js

24 lines
564 B
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
var zipObject = require('../');
var test = require('tape');
test('creates object from list of arrays', function (t) {
var obj = zipObject(['key1', 'key2'], ['value1', 'value2']);
var expected = {
key1: 'value1',
key2: 'value2'
};
t.deepEqual(obj, expected, 'created object');
t.end();
});
test('creates object from array of arrays', function (t) {
var obj = zipObject([['key1', 'key2'], ['value1', 'value2']]);
var expected = {
key1: 'value1',
key2: 'value2'
};
t.deepEqual(obj, expected, 'created object');
t.end();
});