Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion test/processor.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,39 @@ describe('DynamoProcessor', () => {
}
});
});
})
});
});

context('with initFields contain a field has value', () => {
it('updates an item with initial and the field was not overwritten', () => {
return helper.putDoc({
id: 5,
str: 'something'
})
.then(data => {
return dp.proc({
table: 'tests',
key: { id: 5 },
set: {
'map1 bar': 'abc'
}
}, {
initFields: {
str: null, map1: {}, map2: {}
}
})
})
.then((item) => {
expect(item).to.deep.equal({
id: 5,
str: 'something',
map1: {
bar: 'abc'
},
map2: {}
});
});
});
});

context('multiple items', () => {
Expand Down