Skip to content

Commit

Permalink
Add breaking test for #78
Browse files Browse the repository at this point in the history
  • Loading branch information
chbrown committed Mar 11, 2021
1 parent f3733fe commit 47e718d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,12 @@ test('issues/44', t => {
t.true(patch_results.every(result => result == null), 'should apply patch successfully')
t.deepEqual(author, {firstName: 'Chris'}, 'patch reference should not be changed')
})

test('issues/78', t => {
const user = {firstName: 'Chris'}
const patch_results = applyPatch(user, [
{op: 'add', path: '/createdAt', value: new Date('2010-08-10T22:10:48Z')},
])
t.true(patch_results.every(result => result == null), 'should apply patch successfully')
t.deepEqual(user['createdAt'].getTime(), 1281478248000, 'should add Date recoverably')
})

0 comments on commit 47e718d

Please sign in to comment.