Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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");
Expand Down Expand Up @@ -31,6 +32,17 @@
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();

Check failure on line 42 in test/index.test.ts

View workflow job for this annotation

GitHub Actions / test

test/index.test.ts > noaa/9455920 > uses constituents supported by neaps

AssertionError: Unsupported constituent: CHI1: expected undefined to be defined ❯ test/index.test.ts:42:13 ❯ test/index.test.ts:38:39
});
});
}
});
});

Expand Down
Loading