v1.2.1 修复1-99年日期错乱的问题;增加单元测试。
This commit is contained in:
11
__tests__/SolarUtil.test.js
Normal file
11
__tests__/SolarUtil.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
var {SolarUtil} = require('../lunar');
|
||||
|
||||
test('isLeapYear()', () => {
|
||||
expect(SolarUtil.isLeapYear(2020)).toBe(true);
|
||||
expect(SolarUtil.isLeapYear(2021)).toBe(false);
|
||||
});
|
||||
|
||||
test('getDaysOfMonth()', () => {
|
||||
expect(SolarUtil.getDaysOfMonth(2020, 1)).toBe(31);
|
||||
expect(SolarUtil.getDaysOfMonth(2021, 2)).toBe(28);
|
||||
});
|
||||
Reference in New Issue
Block a user