@effect-app/infra 4.0.0-beta.324 → 4.0.0-beta.325

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
  # @effect-app/infra
2
2
 
3
+ ## 4.0.0-beta.325
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f233f3d]
8
+ - effect-app@4.0.0-beta.325
9
+
3
10
  ## 4.0.0-beta.324
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect-app/infra",
3
- "version": "4.0.0-beta.324",
3
+ "version": "4.0.0-beta.325",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  "proper-lockfile": "^4.1.2",
17
17
  "pure-rand": "8.4.0",
18
18
  "query-string": "^9.4.0",
19
- "effect-app": "4.0.0-beta.324"
19
+ "effect-app": "4.0.0-beta.325"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@azure/cosmos": "^4.9.3",
@@ -0,0 +1,21 @@
1
+ import { describe, expect, it } from "@effect/vitest"
2
+ import * as S from "effect-app/Schema"
3
+ import { generateFromSchema } from "../src/arbs.js"
4
+
5
+ describe("generateFromSchema number magnitudes", () => {
6
+ it("keeps PositiveNumber and NonNegativeNumber samples realistic", () => {
7
+ const schema = S.Struct({ amount: S.PositiveNumber, weight: S.NonNegativeNumber })
8
+ for (let i = 0; i < 200; i++) {
9
+ const { amount, weight } = generateFromSchema(schema).value
10
+ expect(amount).toBeGreaterThan(0)
11
+ expect(weight).toBeGreaterThanOrEqual(0)
12
+ expect(Math.max(amount, weight)).toBeLessThanOrEqual(1_000_000)
13
+ expect(Number.isFinite(amount * weight)).toBe(true)
14
+ }
15
+ })
16
+
17
+ it("does not change the JSON Schema of the number schemas", () => {
18
+ expect(S.toJsonSchemaDocument(S.PositiveNumber).schema).not.toHaveProperty("maximum")
19
+ expect(S.toJsonSchemaDocument(S.NonNegativeNumber).schema).not.toHaveProperty("maximum")
20
+ })
21
+ })
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arbs-magnitude.test.d.ts","sourceRoot":"","sources":["../arbs-magnitude.test.ts"],"names":[],"mappings":""}