@oliasoft-open-source/units 5.11.1 → 5.11.2-beta-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/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  - [Introduction](#introduction)
6
6
  - [Install](#install)
7
+ - [Testing](#testing)
7
8
  - [Basic usage](#basic-usage)
8
9
  - [Input and conversions](#input-and-conversions)
9
10
  - [Formatting](#formatting)
@@ -11,6 +12,26 @@
11
12
  - [Methods](#methods)
12
13
  - [Constants](#constants)
13
14
 
15
+ ## Testing
16
+
17
+ Use Node.js 26.6.0 and the pnpm version declared in `package.json`, matching CI.
18
+ Tests import their APIs from `node:test` and assertions from `node:assert/strict`.
19
+ Node runs the TypeScript test files directly, without a global test setup or a loader.
20
+
21
+ ```sh
22
+ pnpm install --frozen-lockfile
23
+ pnpm test
24
+ pnpm test:watch
25
+ ```
26
+
27
+ `pnpm test` checks formatting and types, generates the schema validators, and runs all tests with coverage.
28
+ After generating validators with `pnpm compile-validators`, you can also run a file or an individual test:
29
+
30
+ ```sh
31
+ node --test src/numbers/comparison/comparison.test.ts
32
+ node --test --test-name-pattern='pass for unit-only strings' src/numbers/comparison/comparison.test.ts
33
+ ```
34
+
14
35
  ## Introduction
15
36
 
16
37
  Hi, and welcome to Oliasoft's Unit handling repository! [Oliasoft](https://www.oliasoft.com) is using this to convert numbers between different units in all of our products. As you probably know we are doing various physics calculation that relies on precise definitions for all input data. We need to know the valid _range_ and _precision_ of a value as well as what _unit_ the given value represent. Before doing calculations we therefor convert all numbers to proper JavaScript numbers in a given known unit used in the calculations. We refer to these values as **calculation units**. The users of our products are however allowed to input values, either through the GUI or directly using the APIs, in any unit they prefer. We refer to these values as **input units**. We always store the input value together with its unit _unconverted_, hence input units is the same as the **stored units**. Finally, we offer the users to view all graphs and numbers in their preferred units. We refer these values as **view units** (GUI) or **output units** (API).
package/dist/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
 
5
5
  - [Introduction](#introduction)
6
6
  - [Install](#install)
7
+ - [Testing](#testing)
7
8
  - [Basic usage](#basic-usage)
8
9
  - [Input and conversions](#input-and-conversions)
9
10
  - [Formatting](#formatting)
@@ -11,6 +12,26 @@
11
12
  - [Methods](#methods)
12
13
  - [Constants](#constants)
13
14
 
15
+ ## Testing
16
+
17
+ Use Node.js 26.6.0 and the pnpm version declared in `package.json`, matching CI.
18
+ Tests import their APIs from `node:test` and assertions from `node:assert/strict`.
19
+ Node runs the TypeScript test files directly, without a global test setup or a loader.
20
+
21
+ ```sh
22
+ pnpm install --frozen-lockfile
23
+ pnpm test
24
+ pnpm test:watch
25
+ ```
26
+
27
+ `pnpm test` checks formatting and types, generates the schema validators, and runs all tests with coverage.
28
+ After generating validators with `pnpm compile-validators`, you can also run a file or an individual test:
29
+
30
+ ```sh
31
+ node --test src/numbers/comparison/comparison.test.ts
32
+ node --test --test-name-pattern='pass for unit-only strings' src/numbers/comparison/comparison.test.ts
33
+ ```
34
+
14
35
  ## Introduction
15
36
 
16
37
  Hi, and welcome to Oliasoft's Unit handling repository! [Oliasoft](https://www.oliasoft.com) is using this to convert numbers between different units in all of our products. As you probably know we are doing various physics calculation that relies on precise definitions for all input data. We need to know the valid _range_ and _precision_ of a value as well as what _unit_ the given value represent. Before doing calculations we therefor convert all numbers to proper JavaScript numbers in a given known unit used in the calculations. We refer to these values as **calculation units**. The users of our products are however allowed to input values, either through the GUI or directly using the APIs, in any unit they prefer. We refer to these values as **input units**. We always store the input value together with its unit _unconverted_, hence input units is the same as the **stored units**. Finally, we offer the users to view all graphs and numbers in their preferred units. We refer these values as **view units** (GUI) or **output units** (API).