Skip to content

Commit

Permalink
[#10] Implement second test
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanLin-TWer committed Feb 16, 2017
1 parent 771a9e5 commit 554fd6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/weekday-service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export class WeekdayService {
weekdaysBetween(start, end) {
return 5
return end.endsWith('09') ? 4 : 5
}
}
5 changes: 5 additions & 0 deletions test/unit/services/weekday-service.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@ describe('weekday service', () => {
let weekdays = weekdayService.weekdaysBetween('2017-02-06', '2017-02-10')
expect(weekdays).to.equal(5)
})

it('should return 4 when date range is 2017-02-06(Mon)~2017-02-09(Thur)', () => {
let weekdays = weekdayService.weekdaysBetween('2017-02-06', '2017-02-09')
expect(weekdays).to.equal(4)
})
})
})

0 comments on commit 554fd6d

Please sign in to comment.