aewx-metar-parser 2.0.0 → 2.0.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change log
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [2.0.1]
6
+
7
+ - Changed testing to standard Node.js testing suite
8
+ - Fixed `types` in `package.json`
9
+
3
10
  ## 2.0.0
4
11
 
5
12
  - Changed to TypeScript
@@ -1,44 +1,40 @@
1
1
  import { strict as assert } from "node:assert";
2
+ import { describe, it } from "node:test";
2
3
  import { convert } from "./convert.js";
3
- {
4
- const fahrenheit = convert.celsiusToFahrenheit(1);
5
- // console.log(fahrenheit);
6
- assert.ok(fahrenheit > 33.75);
7
- assert.ok(fahrenheit < 33.85);
8
- }
9
- {
10
- const hgin = convert.kpaToInhg(1);
11
- // console.log(hgin);
12
- assert.ok(hgin > 0.29);
13
- assert.ok(hgin < 0.3);
14
- }
15
- {
16
- const kpa = convert.inhgToKpa(1);
17
- // console.log(kpa);
18
- assert.ok(kpa > 3.38);
19
- assert.ok(kpa < 3.39);
20
- }
21
- {
22
- const meters = convert.milesToMeters(1);
23
- // console.log(meters);
24
- assert.ok(meters > 1609);
25
- assert.ok(meters < 1610);
26
- }
27
- {
28
- const mps = convert.kphToMps(1);
29
- // console.log(mps);
30
- assert.ok(mps > 0.277);
31
- assert.ok(mps < 0.278);
32
- }
33
- {
34
- const kts = convert.mpsToKts(1);
35
- // console.log(kts);
36
- assert.ok(kts > 1.94);
37
- assert.ok(kts < 1.95);
38
- }
39
- {
40
- const mps = convert.ktsToMps(1);
41
- // console.log(mps);
42
- assert.ok(mps > 0.51);
43
- assert.ok(mps < 0.52);
44
- }
4
+ describe("Conversion Tests", () => {
5
+ it("should convert temperature units correctly", () => {
6
+ const fahrenheit = convert.celsiusToFahrenheit(1);
7
+ assert.ok(fahrenheit > 33.75);
8
+ assert.ok(fahrenheit < 33.85);
9
+ });
10
+ it("should convert pressure units correctly", () => {
11
+ const hgin = convert.kpaToInhg(1);
12
+ assert.ok(hgin > 0.29);
13
+ assert.ok(hgin < 0.3);
14
+ });
15
+ it("should convert pressure units correctly", () => {
16
+ const kpa = convert.inhgToKpa(1);
17
+ assert.ok(kpa > 3.38);
18
+ assert.ok(kpa < 3.39);
19
+ });
20
+ it("should convert distance units correctly", () => {
21
+ const meters = convert.milesToMeters(1);
22
+ assert.ok(meters > 1609);
23
+ assert.ok(meters < 1610);
24
+ });
25
+ it("should convert speed units correctly", () => {
26
+ const mps = convert.kphToMps(1);
27
+ assert.ok(mps > 0.277);
28
+ assert.ok(mps < 0.278);
29
+ });
30
+ it("should convert nautical speed units correctly", () => {
31
+ const kts = convert.mpsToKts(1);
32
+ assert.ok(kts > 1.94);
33
+ assert.ok(kts < 1.95);
34
+ });
35
+ it("should convert back nautical speed units correctly", () => {
36
+ const mps = convert.ktsToMps(1);
37
+ assert.ok(mps > 0.51);
38
+ assert.ok(mps < 0.52);
39
+ });
40
+ });