@@ -10,7 +10,12 @@ import { describe, expect, it } from 'vitest'
1010
1111/*****************************************************************************************************************/
1212
13- import { type EquatorialCoordinate , getCorrectionToEquatorialForAnnualAberration , getCorrectionToEquatorialForDiurnalAberration } from '../src'
13+ import {
14+ type EquatorialCoordinate ,
15+ getCorrectionToEquatorialForAberration ,
16+ getCorrectionToEquatorialForAnnualAberration ,
17+ getCorrectionToEquatorialForDiurnalAberration ,
18+ } from '../src'
1419
1520/*****************************************************************************************************************/
1621
@@ -80,4 +85,34 @@ describe('getCorrectionToEquatorialForDiurnalAberration', () => {
8085 } )
8186} )
8287
88+ /*****************************************************************************************************************/
89+
90+ describe ( 'getCorrectionToEquatorialForAberration' , ( ) => {
91+ it ( 'should be defined' , ( ) => {
92+ expect ( getCorrectionToEquatorialForAberration ) . toBeDefined ( )
93+ } )
94+
95+ it ( 'should return the correct aberration correction for the J2000 default epoch' , ( ) => {
96+ const { ra, dec } = getCorrectionToEquatorialForAberration (
97+ new Date ( '2000-01-01T00:00:00+00:00' ) ,
98+ {
99+ latitude,
100+ longitude
101+ } ,
102+ betelgeuse
103+ )
104+ expect ( ra + betelgeuse . ra ) . toBe ( 88.79875665605677 )
105+ expect ( dec + betelgeuse . dec ) . toBe ( 7.406836962857944 )
106+ } )
107+
108+ it ( 'should return the correct aberration correction for the designated epoch' , ( ) => {
109+ const { ra, dec } = getCorrectionToEquatorialForAberration ( datetime , {
110+ latitude,
111+ longitude
112+ } , betelgeuse )
113+ expect ( ra + betelgeuse . ra ) . toBe ( 88.78844263611573 )
114+ expect ( dec + betelgeuse . dec ) . toBe ( 7.4061425995174766 )
115+ } )
116+ } )
117+
83118/*****************************************************************************************************************/
0 commit comments