From d34516dcd88ee89a4be8c90038bfb71dd087eb18 Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Sat, 10 Jan 2026 11:39:23 -0500 Subject: [PATCH] Add test to validate that all constituents are supported by neaps --- test/index.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/index.test.ts b/test/index.test.ts index 34940c8e2..05f9f1fd2 100755 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -4,6 +4,7 @@ import { join } from "path"; import Ajv2020 from "ajv/dist/2020.js"; import addFormats from "ajv-formats"; import { stations } from "../src/index.js"; +import tidePredictor from "@neaps/tide-predictor"; const ROOT = new URL("..", import.meta.url).pathname; const SCHEMA_PATH = join(ROOT, "schemas", "station.schema.json"); @@ -31,6 +32,17 @@ stations.forEach((station) => { expect(reference, `Unknown reference station: ${id}`).toBeDefined(); }); } + + if (station.harmonic_constituents) { + test("uses constituents supported by neaps", () => { + station.harmonic_constituents.forEach((hc) => { + expect( + tidePredictor.constituents[hc.name], + `Unsupported constituent: ${hc.name}`, + ).toBeDefined(); + }); + }); + } }); });