Skip to content

Commit 47e718d

Browse files
committed
Add breaking test for #78
1 parent f3733fe commit 47e718d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/issues.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,12 @@ test('issues/44', t => {
237237
t.true(patch_results.every(result => result == null), 'should apply patch successfully')
238238
t.deepEqual(author, {firstName: 'Chris'}, 'patch reference should not be changed')
239239
})
240+
241+
test('issues/78', t => {
242+
const user = {firstName: 'Chris'}
243+
const patch_results = applyPatch(user, [
244+
{op: 'add', path: '/createdAt', value: new Date('2010-08-10T22:10:48Z')},
245+
])
246+
t.true(patch_results.every(result => result == null), 'should apply patch successfully')
247+
t.deepEqual(user['createdAt'].getTime(), 1281478248000, 'should add Date recoverably')
248+
})

0 commit comments

Comments
 (0)