metar-taf-parser 0.0.1 → 0.0.2
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 +8 -2
- package/dist/{lib/command → command}/common.d.ts +1 -1
- package/dist/{lib/command → command}/common.js +4 -4
- package/dist/{lib/command → command}/metar.d.ts +5 -1
- package/dist/{lib/command → command}/metar.js +6 -5
- package/dist/{lib/command → command}/remark.d.ts +5 -1
- package/dist/{lib/command → command}/remark.js +130 -148
- package/dist/{lib/commons → commons}/converter.d.ts +0 -0
- package/dist/{lib/commons → commons}/converter.js +2 -2
- package/dist/{lib/commons → commons}/errors.d.ts +7 -2
- package/dist/{lib/commons → commons}/errors.js +8 -3
- package/dist/commons/i18n.d.ts +12 -0
- package/dist/{lib/commons → commons}/i18n.js +12 -4
- package/dist/{lib/helpers → helpers}/helpers.d.ts +0 -1
- package/dist/helpers/helpers.js +23 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +38 -0
- package/dist/locale/de.d.ts +321 -0
- package/dist/locale/de.js +322 -0
- package/dist/locale/en.d.ts +387 -0
- package/dist/locale/en.js +398 -0
- package/dist/locale/fr.d.ts +365 -0
- package/dist/locale/fr.js +376 -0
- package/dist/locale/it.d.ts +337 -0
- package/dist/locale/it.js +338 -0
- package/dist/locale/pl.d.ts +98 -0
- package/dist/locale/pl.js +99 -0
- package/dist/locale/zh-CN.d.ts +111 -0
- package/dist/locale/zh-CN.js +112 -0
- package/dist/model/enum.d.ts +221 -0
- package/dist/model/enum.js +231 -0
- package/dist/{lib/model → model}/model.d.ts +14 -7
- package/dist/{lib/model → model}/model.js +1 -1
- package/dist/parser/parser.d.ts +66 -0
- package/dist/parser/parser.js +322 -0
- package/package.json +8 -3
- package/dist/lib/commons/i18n.d.ts +0 -3
- package/dist/lib/helpers/helpers.js +0 -28
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.js +0 -3
- package/dist/lib/locale/en.json +0 -396
- package/dist/lib/model/enum.d.ts +0 -122
- package/dist/lib/model/enum.js +0 -132
- package/dist/lib/parser/parser.d.ts +0 -26
- package/dist/lib/parser/parser.js +0 -198
- package/dist/tests/command/common.test.d.ts +0 -1
- package/dist/tests/command/common.test.js +0 -102
- package/dist/tests/command/metar.test.d.ts +0 -1
- package/dist/tests/command/metar.test.js +0 -52
- package/dist/tests/command/remark.test.d.ts +0 -1
- package/dist/tests/command/remark.test.js +0 -689
- package/dist/tests/common/converter.test.d.ts +0 -1
- package/dist/tests/common/converter.test.js +0 -78
- package/dist/tests/helpers/helpers.test.d.ts +0 -1
- package/dist/tests/helpers/helpers.test.js +0 -17
- package/dist/tests/parser/parser.test.d.ts +0 -1
- package/dist/tests/parser/parser.test.js +0 -96
|
@@ -1,689 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const remark_1 = require("command/remark");
|
|
4
|
-
describe("CeilingHeightCommand", () => {
|
|
5
|
-
const command = new remark_1.CeilingHeightCommand();
|
|
6
|
-
(() => {
|
|
7
|
-
const code = "CIG 005V010";
|
|
8
|
-
describe(code, () => {
|
|
9
|
-
test("canParse", () => {
|
|
10
|
-
expect(command.canParse(code)).toBe(true);
|
|
11
|
-
});
|
|
12
|
-
test("execute", () => {
|
|
13
|
-
const [res, remarks] = command.execute(code, []);
|
|
14
|
-
expect(res).toBe("");
|
|
15
|
-
expect(remarks).toEqual(["ceiling varying between 500 and 1000 feet"]);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
})();
|
|
19
|
-
});
|
|
20
|
-
describe("CeilingSecondLocationCommand", () => {
|
|
21
|
-
const command = new remark_1.CeilingSecondLocationCommand();
|
|
22
|
-
(() => {
|
|
23
|
-
const code = "CIG 002 RY11";
|
|
24
|
-
describe(code, () => {
|
|
25
|
-
test("canParse", () => {
|
|
26
|
-
expect(command.canParse(code)).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
test("execute", () => {
|
|
29
|
-
const [res, remarks] = command.execute(code, []);
|
|
30
|
-
expect(res).toBe("");
|
|
31
|
-
expect(remarks).toEqual([
|
|
32
|
-
"ceiling of 200 feet mesured by a second sensor located at RY11",
|
|
33
|
-
]);
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
})();
|
|
37
|
-
});
|
|
38
|
-
describe("HailSizeCommand", () => {
|
|
39
|
-
const command = new remark_1.HailSizeCommand();
|
|
40
|
-
(() => {
|
|
41
|
-
const code = "GR 4";
|
|
42
|
-
describe(code, () => {
|
|
43
|
-
test("canParse", () => {
|
|
44
|
-
expect(command.canParse(code)).toBe(true);
|
|
45
|
-
});
|
|
46
|
-
test("execute", () => {
|
|
47
|
-
const [res, remarks] = command.execute(code, []);
|
|
48
|
-
expect(res).toBe("");
|
|
49
|
-
expect(remarks).toEqual([
|
|
50
|
-
"largest hailstones with a diameter of 4 inches",
|
|
51
|
-
]);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
})();
|
|
55
|
-
(() => {
|
|
56
|
-
const code = "GR 1 1/2";
|
|
57
|
-
describe(code, () => {
|
|
58
|
-
test("canParse", () => {
|
|
59
|
-
expect(command.canParse(code)).toBe(true);
|
|
60
|
-
});
|
|
61
|
-
test("execute", () => {
|
|
62
|
-
const [res, remarks] = command.execute(code, []);
|
|
63
|
-
expect(res).toBe("");
|
|
64
|
-
expect(remarks).toEqual([
|
|
65
|
-
"largest hailstones with a diameter of 1 1/2 inches",
|
|
66
|
-
]);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
})();
|
|
70
|
-
});
|
|
71
|
-
describe("HourlyMaximumMinimumTemperatureCommand", () => {
|
|
72
|
-
const command = new remark_1.HourlyMaximumMinimumTemperatureCommand();
|
|
73
|
-
const code = "400121023";
|
|
74
|
-
describe(code, () => {
|
|
75
|
-
test("canParse", () => {
|
|
76
|
-
expect(command.canParse(code)).toBe(true);
|
|
77
|
-
});
|
|
78
|
-
test("execute", () => {
|
|
79
|
-
const [res, remarks] = command.execute(code, []);
|
|
80
|
-
expect(res).toBe("");
|
|
81
|
-
expect(remarks).toEqual([
|
|
82
|
-
"24-hour maximum temperature of 1.2°C and 24-hour minimum temperature of -2.3°C",
|
|
83
|
-
]);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe("HourlyMaximumTemperatureCommand", () => {
|
|
88
|
-
const command = new remark_1.HourlyMaximumTemperatureCommand();
|
|
89
|
-
const code = "10272";
|
|
90
|
-
describe(code, () => {
|
|
91
|
-
test("canParse", () => {
|
|
92
|
-
expect(command.canParse(code)).toBe(true);
|
|
93
|
-
});
|
|
94
|
-
test("execute", () => {
|
|
95
|
-
const [res, remarks] = command.execute(code, []);
|
|
96
|
-
expect(res).toBe("");
|
|
97
|
-
expect(remarks).toEqual(["6-hourly maximum temperature of 27.2°C"]);
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
describe("HourlyMinimumTemperatureCommand", () => {
|
|
102
|
-
const command = new remark_1.HourlyMinimumTemperatureCommand();
|
|
103
|
-
const code = "20283";
|
|
104
|
-
describe(code, () => {
|
|
105
|
-
test("canParse", () => {
|
|
106
|
-
expect(command.canParse(code)).toBe(true);
|
|
107
|
-
});
|
|
108
|
-
test("execute", () => {
|
|
109
|
-
const [res, remarks] = command.execute(code, []);
|
|
110
|
-
expect(res).toBe("");
|
|
111
|
-
expect(remarks).toEqual(["6-hourly minimum temperature of 28.3°C"]);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
describe("HourlyPrecipitationAmountCommand", () => {
|
|
116
|
-
const command = new remark_1.HourlyPrecipitationAmountCommand();
|
|
117
|
-
const code = "P0008";
|
|
118
|
-
describe(code, () => {
|
|
119
|
-
test("canParse", () => {
|
|
120
|
-
expect(command.canParse(code)).toBe(true);
|
|
121
|
-
});
|
|
122
|
-
test("execute", () => {
|
|
123
|
-
const [res, remarks] = command.execute(code, []);
|
|
124
|
-
expect(res).toBe("");
|
|
125
|
-
expect(remarks).toEqual([
|
|
126
|
-
"8/100 of an inch of precipitation fell in the last hour",
|
|
127
|
-
]);
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
describe("HourlyPressureCommand", () => {
|
|
132
|
-
const command = new remark_1.HourlyPressureCommand();
|
|
133
|
-
const code = "52032";
|
|
134
|
-
describe(code, () => {
|
|
135
|
-
test("canParse", () => {
|
|
136
|
-
expect(command.canParse(code)).toBe(true);
|
|
137
|
-
});
|
|
138
|
-
test("execute", () => {
|
|
139
|
-
const [res, remarks] = command.execute(code, []);
|
|
140
|
-
expect(res).toBe("");
|
|
141
|
-
expect(remarks).toEqual([
|
|
142
|
-
"steady or unsteady increase of 2 hectopascals in the past 3 hours",
|
|
143
|
-
]);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
});
|
|
147
|
-
describe("HourlyTemperatureDewPointCommand", () => {
|
|
148
|
-
const command = new remark_1.HourlyTemperatureDewPointCommand();
|
|
149
|
-
(() => {
|
|
150
|
-
const code = "T0217";
|
|
151
|
-
describe(code, () => {
|
|
152
|
-
test("canParse", () => {
|
|
153
|
-
expect(command.canParse(code)).toBe(true);
|
|
154
|
-
});
|
|
155
|
-
test("execute", () => {
|
|
156
|
-
const [res, remarks] = command.execute(code, []);
|
|
157
|
-
expect(res).toBe("");
|
|
158
|
-
expect(remarks).toEqual(["hourly temperature of 21.7°C"]);
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
})();
|
|
162
|
-
(() => {
|
|
163
|
-
const code = "T02170144";
|
|
164
|
-
describe(code, () => {
|
|
165
|
-
test("canParse", () => {
|
|
166
|
-
expect(command.canParse(code)).toBe(true);
|
|
167
|
-
});
|
|
168
|
-
test("execute", () => {
|
|
169
|
-
const [res, remarks] = command.execute(code, []);
|
|
170
|
-
expect(res).toBe("");
|
|
171
|
-
expect(remarks).toEqual([
|
|
172
|
-
"hourly temperature of 21.7°C and dew point of 14.4°C",
|
|
173
|
-
]);
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
})();
|
|
177
|
-
});
|
|
178
|
-
describe("IceAccretionCommand", () => {
|
|
179
|
-
const command = new remark_1.IceAccretionCommand();
|
|
180
|
-
const code = "l1001";
|
|
181
|
-
describe(code, () => {
|
|
182
|
-
test("canParse", () => {
|
|
183
|
-
expect(command.canParse(code)).toBe(true);
|
|
184
|
-
});
|
|
185
|
-
test("execute", () => {
|
|
186
|
-
const [res, remarks] = command.execute(code, []);
|
|
187
|
-
expect(res).toBe("");
|
|
188
|
-
expect(remarks).toEqual([
|
|
189
|
-
"1/100 of an inch of ice accretion in the past 1 hour(s)",
|
|
190
|
-
]);
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
describe("ObscurationCommand", () => {
|
|
195
|
-
const command = new remark_1.ObscurationCommand();
|
|
196
|
-
const code = "FU BKN020";
|
|
197
|
-
describe(code, () => {
|
|
198
|
-
test("canParse", () => {
|
|
199
|
-
expect(command.canParse(code)).toBe(true);
|
|
200
|
-
});
|
|
201
|
-
test("execute", () => {
|
|
202
|
-
const [res, remarks] = command.execute(code, []);
|
|
203
|
-
expect(res).toBe("");
|
|
204
|
-
expect(remarks).toEqual(["broken layer at 2000 feet composed of smoke"]);
|
|
205
|
-
});
|
|
206
|
-
});
|
|
207
|
-
});
|
|
208
|
-
describe("PrecipitationAmount24HourCommand", () => {
|
|
209
|
-
const command = new remark_1.PrecipitationAmount24HourCommand();
|
|
210
|
-
const code = "70125";
|
|
211
|
-
describe(code, () => {
|
|
212
|
-
test("canParse", () => {
|
|
213
|
-
expect(command.canParse(code)).toBe(true);
|
|
214
|
-
});
|
|
215
|
-
test("execute", () => {
|
|
216
|
-
const [res, remarks] = command.execute(code, []);
|
|
217
|
-
expect(res).toBe("");
|
|
218
|
-
expect(remarks).toEqual([
|
|
219
|
-
"1.25 inches of precipitation fell in the last 24 hours",
|
|
220
|
-
]);
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
describe("PrecipitationAmount36HourCommand", () => {
|
|
225
|
-
const command = new remark_1.PrecipitationAmount36HourCommand();
|
|
226
|
-
const code = "60225";
|
|
227
|
-
describe(code, () => {
|
|
228
|
-
test("canParse", () => {
|
|
229
|
-
expect(command.canParse(code)).toBe(true);
|
|
230
|
-
});
|
|
231
|
-
test("execute", () => {
|
|
232
|
-
const [res, remarks] = command.execute(code, []);
|
|
233
|
-
expect(res).toBe("");
|
|
234
|
-
expect(remarks).toEqual([
|
|
235
|
-
"2.25 inches of precipitation fell in the last 6 hours",
|
|
236
|
-
]);
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
describe("PrecipitationBegEndCommand", () => {
|
|
241
|
-
const command = new remark_1.PrecipitationBegEndCommand();
|
|
242
|
-
(() => {
|
|
243
|
-
const code = "RAB20E51";
|
|
244
|
-
describe(code, () => {
|
|
245
|
-
test("canParse", () => {
|
|
246
|
-
expect(command.canParse(code)).toBe(true);
|
|
247
|
-
});
|
|
248
|
-
test("execute", () => {
|
|
249
|
-
const [res, remarks] = command.execute(code, []);
|
|
250
|
-
expect(res).toBe("");
|
|
251
|
-
expect(remarks).toEqual([" rain beginning at :20 ending at :51"]);
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
})();
|
|
255
|
-
(() => {
|
|
256
|
-
const code = "RAB0120E0151";
|
|
257
|
-
describe(code, () => {
|
|
258
|
-
test("canParse", () => {
|
|
259
|
-
expect(command.canParse(code)).toBe(true);
|
|
260
|
-
});
|
|
261
|
-
test("execute", () => {
|
|
262
|
-
const [res, remarks] = command.execute(code, []);
|
|
263
|
-
expect(res).toBe("");
|
|
264
|
-
expect(remarks).toEqual([" rain beginning at 01:20 ending at 01:51"]);
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
})();
|
|
268
|
-
(() => {
|
|
269
|
-
const code = "BLRAB0120E0151";
|
|
270
|
-
describe(code, () => {
|
|
271
|
-
test("canParse", () => {
|
|
272
|
-
expect(command.canParse(code)).toBe(true);
|
|
273
|
-
});
|
|
274
|
-
test("execute", () => {
|
|
275
|
-
const [res, remarks] = command.execute(code, []);
|
|
276
|
-
expect(res).toBe("");
|
|
277
|
-
expect(remarks).toEqual([
|
|
278
|
-
"blowing rain beginning at 01:20 ending at 01:51",
|
|
279
|
-
]);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
})();
|
|
283
|
-
});
|
|
284
|
-
describe("PrevailingVisibilityCommand", () => {
|
|
285
|
-
const command = new remark_1.PrevailingVisibilityCommand();
|
|
286
|
-
const code = "VIS 1/2V2";
|
|
287
|
-
describe(code, () => {
|
|
288
|
-
test("canParse", () => {
|
|
289
|
-
expect(command.canParse(code)).toBe(true);
|
|
290
|
-
});
|
|
291
|
-
test("execute", () => {
|
|
292
|
-
const [res, remarks] = command.execute(code, []);
|
|
293
|
-
expect(res).toBe("");
|
|
294
|
-
expect(remarks).toEqual([
|
|
295
|
-
"variable prevailing visibility between 1/2 and 2 SM",
|
|
296
|
-
]);
|
|
297
|
-
});
|
|
298
|
-
});
|
|
299
|
-
});
|
|
300
|
-
describe("SeaLevelPressureCommand", () => {
|
|
301
|
-
const command = new remark_1.SeaLevelPressureCommand();
|
|
302
|
-
const code = "SLP117";
|
|
303
|
-
describe(code, () => {
|
|
304
|
-
test("canParse", () => {
|
|
305
|
-
expect(command.canParse(code)).toBe(true);
|
|
306
|
-
});
|
|
307
|
-
test("execute", () => {
|
|
308
|
-
const [res, remarks] = command.execute(code, []);
|
|
309
|
-
expect(res).toBe("");
|
|
310
|
-
expect(remarks).toEqual(["sea level pressure of 1011.7 HPa"]);
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
describe("SecondLocationVisibilityCommand", () => {
|
|
315
|
-
const command = new remark_1.SecondLocationVisibilityCommand();
|
|
316
|
-
const code = "VIS 1/2 RWY12";
|
|
317
|
-
describe(code, () => {
|
|
318
|
-
test("canParse", () => {
|
|
319
|
-
expect(command.canParse(code)).toBe(true);
|
|
320
|
-
});
|
|
321
|
-
test("execute", () => {
|
|
322
|
-
const [res, remarks] = command.execute(code, []);
|
|
323
|
-
expect(res).toBe("");
|
|
324
|
-
expect(remarks).toEqual([
|
|
325
|
-
"visibility of 1/2 SM mesured by a second sensor located at RWY12",
|
|
326
|
-
]);
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
describe("SectorVisibilityCommand", () => {
|
|
331
|
-
const command = new remark_1.SectorVisibilityCommand();
|
|
332
|
-
const code = "VIS SW 1 1/2";
|
|
333
|
-
describe(code, () => {
|
|
334
|
-
test("canParse", () => {
|
|
335
|
-
expect(command.canParse(code)).toBe(true);
|
|
336
|
-
});
|
|
337
|
-
test("execute", () => {
|
|
338
|
-
const [res, remarks] = command.execute(code, []);
|
|
339
|
-
expect(res).toBe("");
|
|
340
|
-
expect(remarks).toEqual([
|
|
341
|
-
"visibility of 1 1/2 SM in the South West direction",
|
|
342
|
-
]);
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
describe("SmallHailSizeCommand", () => {
|
|
347
|
-
const command = new remark_1.SmallHailSizeCommand();
|
|
348
|
-
const code = "GR LESS THAN 1/4";
|
|
349
|
-
describe(code, () => {
|
|
350
|
-
test("canParse", () => {
|
|
351
|
-
expect(command.canParse(code)).toBe(true);
|
|
352
|
-
});
|
|
353
|
-
test("execute", () => {
|
|
354
|
-
const [res, remarks] = command.execute(code, []);
|
|
355
|
-
expect(res).toBe("");
|
|
356
|
-
expect(remarks).toEqual([
|
|
357
|
-
"largest hailstones with a diameter less than 1/4 inches",
|
|
358
|
-
]);
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
});
|
|
362
|
-
describe("SnowDepthCommand", () => {
|
|
363
|
-
const command = new remark_1.SnowDepthCommand();
|
|
364
|
-
const code = "4/011";
|
|
365
|
-
describe(code, () => {
|
|
366
|
-
test("canParse", () => {
|
|
367
|
-
expect(command.canParse(code)).toBe(true);
|
|
368
|
-
});
|
|
369
|
-
test("execute", () => {
|
|
370
|
-
const [res, remarks] = command.execute(code, []);
|
|
371
|
-
expect(res).toBe("");
|
|
372
|
-
expect(remarks).toEqual(["snow depth of 11 inches"]);
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
});
|
|
376
|
-
describe("SnowIncreaseCommand", () => {
|
|
377
|
-
const command = new remark_1.SnowIncreaseCommand();
|
|
378
|
-
const code = "SNINCR 2/10";
|
|
379
|
-
describe(code, () => {
|
|
380
|
-
test("canParse", () => {
|
|
381
|
-
expect(command.canParse(code)).toBe(true);
|
|
382
|
-
});
|
|
383
|
-
test("execute", () => {
|
|
384
|
-
const [res, remarks] = command.execute(code, []);
|
|
385
|
-
expect(res).toBe("");
|
|
386
|
-
expect(remarks).toEqual([
|
|
387
|
-
"snow depth increase of 2 inches in the past hour with a total depth on the ground of 10 inches",
|
|
388
|
-
]);
|
|
389
|
-
});
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
describe("SnowPelletsCommand", () => {
|
|
393
|
-
const command = new remark_1.SnowPelletsCommand();
|
|
394
|
-
const code = "GS HVY";
|
|
395
|
-
describe(code, () => {
|
|
396
|
-
test("canParse", () => {
|
|
397
|
-
expect(command.canParse(code)).toBe(true);
|
|
398
|
-
});
|
|
399
|
-
test("execute", () => {
|
|
400
|
-
const [res, remarks] = command.execute(code, []);
|
|
401
|
-
expect(res).toBe("");
|
|
402
|
-
expect(remarks).toEqual(["heavy snow pellets"]);
|
|
403
|
-
});
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
describe("SunshineDurationCommand", () => {
|
|
407
|
-
const command = new remark_1.SunshineDurationCommand();
|
|
408
|
-
const code = "98460";
|
|
409
|
-
describe(code, () => {
|
|
410
|
-
test("canParse", () => {
|
|
411
|
-
expect(command.canParse(code)).toBe(true);
|
|
412
|
-
});
|
|
413
|
-
test("execute", () => {
|
|
414
|
-
const [res, remarks] = command.execute(code, []);
|
|
415
|
-
expect(res).toBe("");
|
|
416
|
-
expect(remarks).toEqual(["460 minutes of sunshine"]);
|
|
417
|
-
});
|
|
418
|
-
});
|
|
419
|
-
});
|
|
420
|
-
describe("SurfaceVisibilityCommand", () => {
|
|
421
|
-
const command = new remark_1.SurfaceVisibilityCommand();
|
|
422
|
-
const code = "SFC VIS 8";
|
|
423
|
-
describe(code, () => {
|
|
424
|
-
test("canParse", () => {
|
|
425
|
-
expect(command.canParse(code)).toBe(true);
|
|
426
|
-
});
|
|
427
|
-
test("execute", () => {
|
|
428
|
-
const [res, remarks] = command.execute(code, []);
|
|
429
|
-
expect(res).toBe("");
|
|
430
|
-
expect(remarks).toEqual(["surface visibility of 8 statute miles"]);
|
|
431
|
-
});
|
|
432
|
-
});
|
|
433
|
-
});
|
|
434
|
-
describe("ThunderStormLocationCommand", () => {
|
|
435
|
-
const command = new remark_1.ThunderStormLocationCommand();
|
|
436
|
-
const code = "TS NE";
|
|
437
|
-
describe(code, () => {
|
|
438
|
-
test("canParse", () => {
|
|
439
|
-
expect(command.canParse(code)).toBe(true);
|
|
440
|
-
});
|
|
441
|
-
test("execute", () => {
|
|
442
|
-
const [res, remarks] = command.execute(code, []);
|
|
443
|
-
expect(res).toBe("");
|
|
444
|
-
expect(remarks).toEqual(["thunderstorm North East of the station"]);
|
|
445
|
-
});
|
|
446
|
-
});
|
|
447
|
-
});
|
|
448
|
-
describe("ThunderStormLocationMovingCommand", () => {
|
|
449
|
-
const command = new remark_1.ThunderStormLocationMovingCommand();
|
|
450
|
-
const code = "TS SE MOV NE";
|
|
451
|
-
describe(code, () => {
|
|
452
|
-
test("canParse", () => {
|
|
453
|
-
expect(command.canParse(code)).toBe(true);
|
|
454
|
-
});
|
|
455
|
-
test("execute", () => {
|
|
456
|
-
const [res, remarks] = command.execute(code, []);
|
|
457
|
-
expect(res).toBe("");
|
|
458
|
-
expect(remarks).toEqual([
|
|
459
|
-
"thunderstorm South East of the station moving towards North East",
|
|
460
|
-
]);
|
|
461
|
-
});
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
describe("TornadicActivityBegCommand", () => {
|
|
465
|
-
const command = new remark_1.TornadicActivityBegCommand();
|
|
466
|
-
const code = "TORNADO B1112 4 SW";
|
|
467
|
-
describe(code, () => {
|
|
468
|
-
test("canParse", () => {
|
|
469
|
-
expect(command.canParse(code)).toBe(true);
|
|
470
|
-
});
|
|
471
|
-
test("execute", () => {
|
|
472
|
-
const [res, remarks] = command.execute(code, []);
|
|
473
|
-
expect(res).toBe("");
|
|
474
|
-
expect(remarks).toEqual([
|
|
475
|
-
"tornado beginning at 11:12 4 SM South West of the station",
|
|
476
|
-
]);
|
|
477
|
-
});
|
|
478
|
-
});
|
|
479
|
-
});
|
|
480
|
-
describe("TornadicActivityBegEndCommand", () => {
|
|
481
|
-
const command = new remark_1.TornadicActivityBegEndCommand();
|
|
482
|
-
const code = "TORNADO B1112E1234 4 SW";
|
|
483
|
-
describe(code, () => {
|
|
484
|
-
test("canParse", () => {
|
|
485
|
-
expect(command.canParse(code)).toBe(true);
|
|
486
|
-
});
|
|
487
|
-
test("execute", () => {
|
|
488
|
-
const [res, remarks] = command.execute(code, []);
|
|
489
|
-
expect(res).toBe("");
|
|
490
|
-
expect(remarks).toEqual([
|
|
491
|
-
"tornado beginning at 11:12 ending at 12:34 4 SM South West of the station",
|
|
492
|
-
]);
|
|
493
|
-
});
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
describe("TornadicActivityEndCommand", () => {
|
|
497
|
-
const command = new remark_1.TornadicActivityEndCommand();
|
|
498
|
-
const code = "TORNADO E1234 4 SW";
|
|
499
|
-
describe(code, () => {
|
|
500
|
-
test("canParse", () => {
|
|
501
|
-
expect(command.canParse(code)).toBe(true);
|
|
502
|
-
});
|
|
503
|
-
test("execute", () => {
|
|
504
|
-
const [res, remarks] = command.execute(code, []);
|
|
505
|
-
expect(res).toBe("");
|
|
506
|
-
expect(remarks).toEqual([
|
|
507
|
-
"tornado ending at 12:34 4 SM South West of the station",
|
|
508
|
-
]);
|
|
509
|
-
});
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
describe("TowerVisibilityCommand", () => {
|
|
513
|
-
const command = new remark_1.TowerVisibilityCommand();
|
|
514
|
-
const code = "TWR VIS 3";
|
|
515
|
-
describe(code, () => {
|
|
516
|
-
test("canParse", () => {
|
|
517
|
-
expect(command.canParse(code)).toBe(true);
|
|
518
|
-
});
|
|
519
|
-
test("execute", () => {
|
|
520
|
-
const [res, remarks] = command.execute(code, []);
|
|
521
|
-
expect(res).toBe("");
|
|
522
|
-
expect(remarks).toEqual(["control tower visibility of 3 statute miles"]);
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
});
|
|
526
|
-
describe("VariableSkyCommand", () => {
|
|
527
|
-
const command = new remark_1.VariableSkyCommand();
|
|
528
|
-
const code = "SCT V BKN";
|
|
529
|
-
describe(code, () => {
|
|
530
|
-
test("canParse", () => {
|
|
531
|
-
expect(command.canParse(code)).toBe(true);
|
|
532
|
-
});
|
|
533
|
-
test("execute", () => {
|
|
534
|
-
const [res, remarks] = command.execute(code, []);
|
|
535
|
-
expect(res).toBe("");
|
|
536
|
-
expect(remarks).toEqual([
|
|
537
|
-
"cloud layer varying between scattered and broken",
|
|
538
|
-
]);
|
|
539
|
-
});
|
|
540
|
-
});
|
|
541
|
-
});
|
|
542
|
-
describe("VariableSkyHeightCommand", () => {
|
|
543
|
-
const command = new remark_1.VariableSkyHeightCommand();
|
|
544
|
-
const code = "SCT008 V BKN";
|
|
545
|
-
describe(code, () => {
|
|
546
|
-
test("canParse", () => {
|
|
547
|
-
expect(command.canParse(code)).toBe(true);
|
|
548
|
-
});
|
|
549
|
-
test("execute", () => {
|
|
550
|
-
const [res, remarks] = command.execute(code, []);
|
|
551
|
-
expect(res).toBe("");
|
|
552
|
-
expect(remarks).toEqual([
|
|
553
|
-
"cloud layer at 800 feet varying between scattered and broken",
|
|
554
|
-
]);
|
|
555
|
-
});
|
|
556
|
-
});
|
|
557
|
-
});
|
|
558
|
-
describe("VirgaDirectionCommand", () => {
|
|
559
|
-
const command = new remark_1.VirgaDirectionCommand();
|
|
560
|
-
const code = "VIRGA SW";
|
|
561
|
-
describe(code, () => {
|
|
562
|
-
test("canParse", () => {
|
|
563
|
-
expect(command.canParse(code)).toBe(true);
|
|
564
|
-
});
|
|
565
|
-
test("execute", () => {
|
|
566
|
-
const [res, remarks] = command.execute(code, []);
|
|
567
|
-
expect(res).toBe("");
|
|
568
|
-
expect(remarks).toEqual(["virga South West from the station"]);
|
|
569
|
-
});
|
|
570
|
-
});
|
|
571
|
-
});
|
|
572
|
-
describe("WaterEquivalentSnowCommand", () => {
|
|
573
|
-
const command = new remark_1.WaterEquivalentSnowCommand();
|
|
574
|
-
const code = "933125";
|
|
575
|
-
describe(code, () => {
|
|
576
|
-
test("canParse", () => {
|
|
577
|
-
expect(command.canParse(code)).toBe(true);
|
|
578
|
-
});
|
|
579
|
-
test("execute", () => {
|
|
580
|
-
const [res, remarks] = command.execute(code, []);
|
|
581
|
-
expect(res).toBe("");
|
|
582
|
-
expect(remarks).toEqual(["water equivalent of 12.5 inches of snow"]);
|
|
583
|
-
});
|
|
584
|
-
});
|
|
585
|
-
});
|
|
586
|
-
describe("WindPeakCommand", () => {
|
|
587
|
-
const command = new remark_1.WindPeakCommand();
|
|
588
|
-
const code = "PK WND 29027/2250";
|
|
589
|
-
describe(code, () => {
|
|
590
|
-
test("canParse", () => {
|
|
591
|
-
expect(command.canParse(code)).toBe(true);
|
|
592
|
-
});
|
|
593
|
-
test("execute", () => {
|
|
594
|
-
const [res, remarks] = command.execute(code, []);
|
|
595
|
-
expect(res).toBe("");
|
|
596
|
-
expect(remarks).toEqual([
|
|
597
|
-
"peak wind of 27 knots from 290 degrees at 22:50",
|
|
598
|
-
]);
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
describe("WindShiftCommand", () => {
|
|
603
|
-
const command = new remark_1.WindShiftCommand();
|
|
604
|
-
const code = "WSHFT 2241";
|
|
605
|
-
describe(code, () => {
|
|
606
|
-
test("canParse", () => {
|
|
607
|
-
expect(command.canParse(code)).toBe(true);
|
|
608
|
-
});
|
|
609
|
-
test("execute", () => {
|
|
610
|
-
const [res, remarks] = command.execute(code, []);
|
|
611
|
-
expect(res).toBe("");
|
|
612
|
-
expect(remarks).toEqual(["wind shift at 22:41"]);
|
|
613
|
-
});
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
describe("WindShiftFropaCommand", () => {
|
|
617
|
-
const command = new remark_1.WindShiftFropaCommand();
|
|
618
|
-
const code = "WSHFT 2241 FROPA";
|
|
619
|
-
describe(code, () => {
|
|
620
|
-
test("canParse", () => {
|
|
621
|
-
expect(command.canParse(code)).toBe(true);
|
|
622
|
-
});
|
|
623
|
-
test("execute", () => {
|
|
624
|
-
const [res, remarks] = command.execute(code, []);
|
|
625
|
-
expect(res).toBe("");
|
|
626
|
-
expect(remarks).toEqual([
|
|
627
|
-
"wind shift accompanied by frontal passage at 22:41",
|
|
628
|
-
]);
|
|
629
|
-
});
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
describe("WindShiftFropaCommand", () => {
|
|
633
|
-
const command = new remark_1.WindShiftFropaCommand();
|
|
634
|
-
const code = "WSHFT 2241 FROPA";
|
|
635
|
-
describe(code, () => {
|
|
636
|
-
test("canParse", () => {
|
|
637
|
-
expect(command.canParse(code)).toBe(true);
|
|
638
|
-
});
|
|
639
|
-
test("execute", () => {
|
|
640
|
-
const [res, remarks] = command.execute(code, []);
|
|
641
|
-
expect(res).toBe("");
|
|
642
|
-
expect(remarks).toEqual([
|
|
643
|
-
"wind shift accompanied by frontal passage at 22:41",
|
|
644
|
-
]);
|
|
645
|
-
});
|
|
646
|
-
});
|
|
647
|
-
});
|
|
648
|
-
describe("DefaultCommand", () => {
|
|
649
|
-
const command = new remark_1.DefaultCommand();
|
|
650
|
-
(() => {
|
|
651
|
-
const code = "AO1";
|
|
652
|
-
describe(code, () => {
|
|
653
|
-
test("canParse", () => {
|
|
654
|
-
expect(command.canParse()).toBe(true);
|
|
655
|
-
});
|
|
656
|
-
test("execute", () => {
|
|
657
|
-
const [res, remarks] = command.execute(code, []);
|
|
658
|
-
expect(res).toBe("");
|
|
659
|
-
expect(remarks).toEqual([
|
|
660
|
-
"automated stations without a precipitation discriminator",
|
|
661
|
-
]);
|
|
662
|
-
});
|
|
663
|
-
});
|
|
664
|
-
})();
|
|
665
|
-
(() => {
|
|
666
|
-
const code = "BOGUS";
|
|
667
|
-
describe(code, () => {
|
|
668
|
-
test("canParse", () => {
|
|
669
|
-
expect(command.canParse()).toBe(true);
|
|
670
|
-
});
|
|
671
|
-
test("execute", () => {
|
|
672
|
-
const [res, remarks] = command.execute(code, []);
|
|
673
|
-
expect(res).toBe("");
|
|
674
|
-
expect(remarks).toEqual(["BOGUS"]);
|
|
675
|
-
});
|
|
676
|
-
});
|
|
677
|
-
})();
|
|
678
|
-
});
|
|
679
|
-
describe("RemarkCommandSupplier", () => {
|
|
680
|
-
const supplier = new remark_1.RemarkCommandSupplier();
|
|
681
|
-
test("gets WindShiftFropaCommand command", () => {
|
|
682
|
-
const code = "WSHFT 2241 FROPA";
|
|
683
|
-
expect(supplier.get(code)).toBeInstanceOf(remark_1.WindShiftFropaCommand);
|
|
684
|
-
});
|
|
685
|
-
test("returns DefaultCommand if unknown", () => {
|
|
686
|
-
const code = "bogus";
|
|
687
|
-
expect(supplier.get(code)).toBeInstanceOf(remark_1.DefaultCommand);
|
|
688
|
-
});
|
|
689
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|