Skip to content

Commit

Permalink
test: add failing test for #74
Browse files Browse the repository at this point in the history
  • Loading branch information
wankdanker committed Jan 1, 2020
1 parent 574acca commit d7a23d0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2637,3 +2637,22 @@ test("issue #71: mapping array should not fail when not defined", t => {
t.deepEqual(result, expect);
t.end();
});

test("issue #74: mapping empty array should result in empty array", t => {
const src = {nbMember : 5, activityList: []};

const map = {
'nbMember': 'maxPlayerCount'
, 'activityList[].id': 'activityList[].id'
};

const expect = {
activityList: []
, maxPlayerCount: 5
}

const result = om(src, map);

t.deepEqual(result, expect);
t.end();
});

0 comments on commit d7a23d0

Please sign in to comment.