diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd2ddd8..fc0d2fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,6 @@ jobs: - run: npm ci --ignore-scripts - - run: npm ci --ignore-scripts - - run: npm run build test: needs: build diff --git a/.gitignore b/.gitignore index 78dc869..3455d50 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ .vscode/settings.json coverage /commonjs/ -lib +/lib/ node_modules *.log diff --git a/test/lib/compareVectors.ts b/test/lib/compareVectors.ts new file mode 100644 index 0000000..09d3c22 --- /dev/null +++ b/test/lib/compareVectors.ts @@ -0,0 +1,17 @@ +/** + * Helper from satellite.js to compare vectors + */ + +import { Vec3 } from 'lib/ootk-core'; + +export const compareVectors = (vector1: Vec3, vector2: Vec3, numDigits: number) => { + if (!numDigits) { + expect(vector1.x).toEqual(vector2.x); + expect(vector1.y).toEqual(vector2.y); + expect(vector1.z).toEqual(vector2.z); + } else { + expect(vector1.x).toBeCloseTo(vector2.x, numDigits); + expect(vector1.y).toBeCloseTo(vector2.y, numDigits); + expect(vector1.z).toBeCloseTo(vector2.z, numDigits); + } +}; diff --git a/test/sun-moon/sun-moon.test.ts b/test/sun-moon/sun-moon.test.ts index 0609566..f55315e 100644 --- a/test/sun-moon/sun-moon.test.ts +++ b/test/sun-moon/sun-moon.test.ts @@ -37,6 +37,9 @@ describe('Sun and Moon', () => { }); test('getMoonIllumination returns fraction and angle of moons illuminated limb and phase', () => { + // eslint-disable-next-line no-console + console.log('dateObj', dateObj); + const moonIllum = Moon.getMoonIllumination(dateObj); expect(moonIllum).toMatchSnapshot();