lunisolar
Version:
专业农历库,支持公历阴历互转,支持各类黄历数据查询,如八字四柱、阴历、神煞宜忌、时辰吉凶、建除十二神、胎神占方、五行纳音等。支持自定义插件。
46 lines (41 loc) • 1.61 kB
text/typescript
import lunisolar from '../../../../src/index'
import { monthGods } from '../../../../src/plugins/theGods/gods/monthGods'
describe('plugins/theGods/gods/不将', () => {
const bujiangChenkFunc = monthGods.不將[0]
it('2022-02-05 寅月', () => {
const lsr = lunisolar('2022-02-05')
const bujiangList = bujiangChenkFunc<number[]>(lsr)
const testArr = [2, 3, 12, 13, 15, 23, 25, 26, 27, 35, 36, 37, 47]
expect(bujiangList.length).toBe(testArr.length)
testArr.forEach(item => {
expect(bujiangList.includes(item)).toBe(true)
})
})
it('2022-03-08 卯月', () => {
const lsr = lunisolar('2022-03-08')
const bujiangList = bujiangChenkFunc<number[]>(lsr)
const testArr = [1, 2, 11, 12, 13, 22, 23, 25, 26, 35, 36, 46]
expect(bujiangList.length).toBe(testArr.length)
testArr.forEach(item => {
expect(bujiangList.includes(item)).toBe(true)
})
})
it('2022-05-08 巳月', () => {
const lsr = lunisolar('2022-05-08')
const bujiangList = bujiangChenkFunc<number[]>(lsr)
const testArr = [0, 10, 11, 12, 10, 21, 22, 23, 24, 32, 33, 34, 44]
expect(bujiangList.length).toBe(testArr.length)
testArr.forEach(item => {
expect(bujiangList.includes(item)).toBe(true)
})
})
it('2022-12-08 子月', () => {
const lsr = lunisolar('2022-12-08')
const bujiangList = bujiangChenkFunc<number[]>(lsr)
const testArr = [3, 5, 13, 15, 16, 17, 25, 26, 27, 28, 37, 38, 53]
expect(bujiangList.length).toBe(testArr.length)
testArr.forEach(item => {
expect(bujiangList.includes(item)).toBe(true)
})
})
})