Skip to content

Commit 6176a24

Browse files
committed
Update tests for tide-database internal id change
1 parent 3d8cebd commit 6176a24

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

packages/neaps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"prepack": "npm run build"
3535
},
3636
"dependencies": {
37-
"@neaps/tide-database": "0.2",
37+
"@neaps/tide-database": "github:neaps/tide-database#stable-id",
3838
"@neaps/tide-predictor": "^0.3.0",
3939
"geolib": "^3.3.4"
4040
}

packages/neaps/test/index.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe("getExtremesPrediction", () => {
6666
test("gets extremes from nearest station", () => {
6767
const prediction = getExtremesPrediction(options);
6868

69-
expect(prediction.station.id).toEqual("us/fl/port-of-palm-beach");
69+
expect(prediction.station.id).toEqual("noaa/8722588");
7070
expect(prediction.datum).toBe("MLLW");
7171

7272
const { extremes } = prediction;
@@ -96,7 +96,7 @@ describe("getTimelinePrediction", () => {
9696
end: new Date("2025-12-19T01:00:00-05:00"),
9797
});
9898

99-
expect(prediction.station.id).toEqual("us/fl/port-of-palm-beach");
99+
expect(prediction.station.id).toEqual("noaa/8722588");
100100
expect(prediction.datum).toBe("MLLW");
101101
expect(prediction.units).toBe("meters");
102102
expect(prediction.timeline.length).toBe(7); // Every 10 minutes for 1 hour = 7 points
@@ -124,7 +124,7 @@ describe("getWaterLevelAtTime", () => {
124124
datum: "MSL",
125125
});
126126

127-
expect(prediction.station.id).toEqual("us/fl/port-of-palm-beach");
127+
expect(prediction.station.id).toEqual("noaa/8722588");
128128
expect(prediction.datum).toBe("MSL");
129129
expect(prediction.time).toEqual(new Date("2025-12-19T05:30:00.000Z"));
130130
expect(typeof prediction.level).toBe("number");
@@ -291,16 +291,16 @@ describe("findStation", () => {
291291
});
292292

293293
test("finds station by id", () => {
294-
const station = findStation("us/ma/boston");
294+
const station = findStation("noaa/8443970");
295295
expect(station).toBeDefined();
296-
expect(station.id).toBe("us/ma/boston");
296+
expect(station.source.id).toBe("8443970");
297297
expect(station.getExtremesPrediction).toBeDefined();
298298
});
299299

300300
test("finds station by source id", () => {
301301
const station = findStation("8443970");
302302
expect(station).toBeDefined();
303-
expect(station.id).toBe("us/ma/boston");
303+
expect(station.id).toBe("noaa/8443970");
304304
expect(station.getExtremesPrediction).toBeDefined();
305305
});
306306
});
@@ -326,7 +326,7 @@ describe("datum", () => {
326326
});
327327

328328
test("throws error for unavailable datum", () => {
329-
const station = findStation("us/ma/boston");
329+
const station = findStation("noaa/8443970");
330330
expect(() => {
331331
station.getExtremesPrediction({
332332
start: new Date("2025-12-17T00:00:00Z"),

0 commit comments

Comments
 (0)