@happyvertical/weather 0.84.0 → 0.85.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -145,6 +145,35 @@ interface WeatherForecast {
|
|
|
145
145
|
| `OPENWEATHER_API_KEY` | string | OpenWeatherMap API key |
|
|
146
146
|
| `HAVE_WEATHER_TIMEOUT` | number | Request timeout (ms) |
|
|
147
147
|
|
|
148
|
+
## Testing
|
|
149
|
+
|
|
150
|
+
The default suite is offline and deterministic, with one key-gated exception.
|
|
151
|
+
Provider responses come from recorded fixtures in `src/__tests__/fixtures/`, so
|
|
152
|
+
on a clean environment no test in `test` reaches the network:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pnpm turbo run test --filter=@happyvertical/weather
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The exception is `google-weather.spec.ts`. It gates on `GOOGLE_API_KEY`, per the
|
|
159
|
+
repository rule that a suite needing a real service gates on a key where one
|
|
160
|
+
exists — see "Network isolation in the default suites" in `.github/CI.md`. With
|
|
161
|
+
the key unset, its live block skips and the offline guarantee holds; that is how
|
|
162
|
+
CI runs it. With the key exported, it calls the live Google Weather API from
|
|
163
|
+
`test`.
|
|
164
|
+
|
|
165
|
+
Coverage against the other live services lives in `*.optional.test.ts` and is
|
|
166
|
+
skipped unless you opt in. OpenWeatherMap gates on its API key; Environment
|
|
167
|
+
Canada needs no key, so it gates on an explicit flag:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
ENVIRONMENT_CANADA_INTEGRATION=1 pnpm --filter @happyvertical/weather test:optional
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Run the live suite after re-recording a fixture, to confirm the upstream payload
|
|
174
|
+
still matches the shape the offline suite asserts. See
|
|
175
|
+
`src/__tests__/fixtures/README.md` for how each fixture was recorded.
|
|
176
|
+
|
|
148
177
|
## Provider Comparison
|
|
149
178
|
|
|
150
179
|
| Feature | Environment Canada | OpenWeatherMap | OWM One Call |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/weather",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "Weather data provider abstraction for HAppyVertical SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@happyvertical/utils": "0.
|
|
44
|
+
"@happyvertical/utils": "0.85.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "25.0.10",
|