1
0
mirror of synced 2026-04-03 09:38:34 +08:00

v1.2.3 修正2016年国庆节数据;删除5月23日世界读书日;修复v1.2.0和v1.2.1的重大bug。

This commit is contained in:
6tail
2021-05-23 22:33:25 +08:00
parent aead9412ed
commit b83fbe8cc7
7 changed files with 345 additions and 172 deletions

View File

@@ -1,4 +1,4 @@
var {Solar} = require('../lunar');
var {Solar, Lunar} = require('../lunar');
it('起运', () => {
const solar = Solar.fromYmdHms(1981, 1, 29, 23, 37, 0);
@@ -10,3 +10,24 @@ it('起运', () => {
expect(yun.getStartDay()).toBe(20);
expect(yun.getStartSolar().toYmd()).toBe('1989-02-18');
});
it('test2', () => {
const lunar = Lunar.fromYmdHms(2019, 12, 12, 11, 22, 0);
const eightChar = lunar.getEightChar();
const yun = eightChar.getYun(1);
expect(yun.getStartYear()).toBe(0);
expect(yun.getStartMonth()).toBe(1);
expect(yun.getStartDay()).toBe(0);
expect(yun.getStartSolar().toYmd()).toBe('2020-02-06');
});
it('test3', () => {
const solar = Solar.fromYmdHms(2020, 1, 6, 11, 22, 0);
const lunar = solar.getLunar();
const eightChar = lunar.getEightChar();
const yun = eightChar.getYun(1);
expect(yun.getStartYear()).toBe(0);
expect(yun.getStartMonth()).toBe(1);
expect(yun.getStartDay()).toBe(0);
expect(yun.getStartSolar().toYmd()).toBe('2020-02-06');
});