Skip to content

Commit b9313bd

Browse files
committed
Add test for missing branch
1 parent 48c0e0e commit b9313bd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/diff/index.test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ describe('.diff', () => {
9797
describe('date', () => {
9898
const lhs = new Date('2016');
9999
const rhs = new Date('2017');
100+
101+
test('returns empty object when dates are equal', () => {
102+
expect(diff(new Date('2016'), new Date('2016'))).toEqual({});
103+
});
104+
100105
test('returns right hand side date when updated', () => {
101106
expect(diff({ date: lhs }, { date: rhs })).toEqual({ date: rhs });
102107
expect(diff([lhs], [rhs])).toEqual({ 0: rhs });

src/updated/index.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,11 @@ describe('.updatedDiff', () => {
9797
expect(updatedDiff([new Date('2016')], [new Date('2017')])).toEqual({ 0: new Date('2017') });
9898
});
9999
});
100+
101+
describe('date', () => {
102+
test('returns empty object when dates are equal', () => {
103+
expect(updatedDiff(new Date('2016'), new Date('2016'))).toEqual({});
104+
});
105+
});
100106
});
101107
});

0 commit comments

Comments
 (0)