|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
584 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | module.exports = function (fromEntries, t) {
|
|---|
| 4 | var a = {};
|
|---|
| 5 | var b = {};
|
|---|
| 6 | var c = {};
|
|---|
| 7 | var entries = [['a', a], ['b', b], ['c', c]];
|
|---|
| 8 | var obj = { a: a, b: b, c: c };
|
|---|
| 9 |
|
|---|
| 10 | t.deepEqual(fromEntries(entries), obj, 'entries -> obj');
|
|---|
| 11 |
|
|---|
| 12 | t['throws'](function () { fromEntries(); }, 'entries throws on absent iterable');
|
|---|
| 13 | t['throws'](function () { fromEntries(undefined); }, 'entries throws on undefined');
|
|---|
| 14 | t['throws'](function () { fromEntries(null); }, 'entries throws on null');
|
|---|
| 15 |
|
|---|
| 16 | t.deepEqual(fromEntries([['foo', 1], ['foo', 2]]), { foo: 2 }, 'works with a duplicate key');
|
|---|
| 17 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.