diff --git a/test/test.js b/test/test.js index 86039c4..38d22f9 100644 --- a/test/test.js +++ b/test/test.js @@ -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(); +}); \ No newline at end of file