v1.2.1 修复1-99年日期错乱的问题;增加单元测试。
This commit is contained in:
13
__tests__/SolarHalfYear.test.js
Normal file
13
__tests__/SolarHalfYear.test.js
Normal file
@@ -0,0 +1,13 @@
|
||||
var {SolarHalfYear} = require('../lunar');
|
||||
|
||||
test('toString()', () => {
|
||||
const halfYear = SolarHalfYear.fromYm(2019, 5);
|
||||
expect(halfYear.toString()).toBe('2019.1');
|
||||
expect(halfYear.next(1).toString()).toBe('2019.2');
|
||||
});
|
||||
|
||||
test('toFullString()', () => {
|
||||
const halfYear = SolarHalfYear.fromYm(2019, 5);
|
||||
expect(halfYear.toFullString()).toBe('2019年上半年');
|
||||
expect(halfYear.next(1).toFullString()).toBe('2019年下半年');
|
||||
});
|
||||
Reference in New Issue
Block a user