@owlmeans/test-integration 0.1.18-rc.32 → 0.1.18-rc.34
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 +134 -8
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/testing-integration/SKILL.md +23 -23
- package/build/cleanup/types.d.ts +20 -0
- package/build/cleanup/types.d.ts.map +1 -0
- package/build/cleanup/types.js +2 -0
- package/build/cleanup/types.js.map +1 -0
- package/build/cleanup.d.ts +5 -12
- package/build/cleanup.d.ts.map +1 -1
- package/build/cleanup.js +23 -25
- package/build/cleanup.js.map +1 -1
- package/build/gates/types.d.ts +18 -0
- package/build/gates/types.d.ts.map +1 -0
- package/build/gates/types.js +2 -0
- package/build/gates/types.js.map +1 -0
- package/build/gates.d.ts +8 -3
- package/build/gates.d.ts.map +1 -1
- package/build/gates.js +39 -27
- package/build/gates.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/reachability/types.d.ts +27 -0
- package/build/reachability/types.d.ts.map +1 -0
- package/build/reachability/types.js +2 -0
- package/build/reachability/types.js.map +1 -0
- package/build/reachability.d.ts +3 -20
- package/build/reachability.d.ts.map +1 -1
- package/build/reachability.js +59 -70
- package/build/reachability.js.map +1 -1
- package/build/types.local.d.ts +0 -1
- package/build/types.local.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/cleanup/types.ts +18 -0
- package/src/cleanup.ts +25 -23
- package/src/gates/types.ts +18 -0
- package/src/gates.ts +58 -39
- package/src/index.ts +2 -0
- package/src/reachability/types.ts +27 -0
- package/src/reachability.ts +64 -72
- package/src/types.local.ts +0 -2
package/README.md
CHANGED
|
@@ -1,15 +1,141 @@
|
|
|
1
1
|
# @owlmeans/test-integration
|
|
2
2
|
|
|
3
|
-
Env-gated harness for integration tests of packages that talk to external services (MongoDB, Redis, S3-compatible storage, Kubernetes). Bundles helper gates and per-run namespacing — the actual driver libraries (`mongodb`, `ioredis`, `@aws-sdk/client-s3`, `@kubernetes/client-node`) stay where they already live, in the consuming integration packages.
|
|
3
|
+
Env-gated harness for integration tests of packages that talk to external services (PostgreSQL, MongoDB, Redis, S3-compatible storage, Kubernetes, SMTP). Bundles helper gates and per-run namespacing — the actual driver libraries (`pg`, `mongodb`, `ioredis`, `@aws-sdk/client-s3`, `@kubernetes/client-node`, `nodemailer`) stay where they already live, in the consuming integration packages. It is a dev dependency of category-C packages; a package whose provider is outside these six services (an LLM provider, the Mailgun HTTP API) declares its own gate with `makeGates` from `@owlmeans/test` instead. The package's skill is `testing-integration`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
```bash
|
|
8
|
+
bun add -d @owlmeans/test-integration@^0.1.18-rc.34
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Concepts
|
|
12
|
+
|
|
13
|
+
- **Integration gate** — `IntegrationGate<E>` = `{ skip, reason?, env }`. Each gate fails closed on
|
|
14
|
+
its required variables; `env` holds only the variables that were actually populated.
|
|
15
|
+
- **Reachability probe** — the three datastore gates also require a host in the connection string
|
|
16
|
+
to accept a TCP connect. A set variable pointing at nothing (a port-forward that is not running)
|
|
17
|
+
closes the gate with a printed reason naming the variable and `host:port`. The probe is
|
|
18
|
+
synchronous, so gates are read at module scope; SRV and unix-socket addresses are not probed.
|
|
19
|
+
- **Namespace** — `randomNamespace(prefix)`, a short random suffix that keeps database names, key
|
|
20
|
+
prefixes, schemas and S3 object prefixes unique per run and per spec file.
|
|
21
|
+
- **Cleanup queue** — `cleanupHelper`, a process-global LIFO queue drained in `afterAll`; safe only
|
|
22
|
+
when a single spec file of the package provisions anything.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Gate and provision in `tests/context.ts`
|
|
27
|
+
|
|
28
|
+
Specs do not call services through these helpers — they consume the per-package real test context
|
|
29
|
+
built in `tests/context.ts` and only check the gate to self-skip when the dependency is missing.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
// tests/context.ts
|
|
33
|
+
import { gateHelper, randomNamespace } from '@owlmeans/test-integration'
|
|
34
|
+
import type { IntegrationGate, MongoEnv } from '@owlmeans/test-integration'
|
|
35
|
+
|
|
36
|
+
export const gate: IntegrationGate<MongoEnv> = gateHelper.mongoGate()
|
|
37
|
+
|
|
38
|
+
export const makeSuite = (label: string) => {
|
|
39
|
+
// calling a gate already loaded the repo-root .env, so defaulted optionals come from process.env
|
|
40
|
+
const prefix = process.env.MONGO_TEST_DB_PREFIX ?? 'omt'
|
|
41
|
+
const database = randomNamespace(`${prefix}_${label}`)
|
|
42
|
+
const url = gate.env.MONGO_URL as string
|
|
43
|
+
|
|
44
|
+
const teardown = async (): Promise<void> => {
|
|
45
|
+
if (gate.skip) return
|
|
46
|
+
/* drop `database` with the driver this package already owns */
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return { database, url, teardown }
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Self-skip a spec
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { afterAll, describe, test } from 'bun:test'
|
|
57
|
+
import { gate, makeSuite } from './context.js'
|
|
58
|
+
|
|
59
|
+
const suite = makeSuite('crud')
|
|
60
|
+
const it = gate.skip ? test.skip : test
|
|
61
|
+
|
|
62
|
+
describe('@owlmeans/mongo — crud', () => {
|
|
63
|
+
if (gate.skip) {
|
|
64
|
+
test.skip(gate.reason ?? 'mongo gate closed', () => {})
|
|
65
|
+
|
|
66
|
+
return
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
afterAll(async () => { await suite.teardown() })
|
|
70
|
+
|
|
71
|
+
it('round-trips a record through a real context', async () => {
|
|
72
|
+
/* boot, exercise, assert */
|
|
73
|
+
}, 60_000)
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### One provisioning spec file: the cleanup queue
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { afterAll } from 'bun:test'
|
|
81
|
+
import { cleanupHelper } from '@owlmeans/test-integration'
|
|
82
|
+
|
|
83
|
+
cleanupHelper.registerCleanup(async () => { await client.db(database).dropDatabase() })
|
|
84
|
+
|
|
85
|
+
afterAll(async () => { await cleanupHelper.runCleanups() }) // LIFO; a failing cleanup is logged, not raised
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## API
|
|
89
|
+
|
|
90
|
+
### Gates
|
|
91
|
+
|
|
92
|
+
| Gate | Required | Optional | Probes |
|
|
93
|
+
|---|---|---|---|
|
|
94
|
+
| `gateHelper.mongoGate()` | `MONGO_URL` | `MONGO_TEST_DB_PREFIX` | TCP, default port 27017 |
|
|
95
|
+
| `gateHelper.postgresGate()` | `POSTGRES_URL` | `POSTGRES_TEST_DB_PREFIX` | TCP, default port 5432 |
|
|
96
|
+
| `gateHelper.redisGate()` | `REDIS_URL` | `REDIS_TEST_KEY_PREFIX` | TCP, default port 6379 |
|
|
97
|
+
| `gateHelper.s3Gate()` | `S3_ENDPOINT`, `S3_KEY`, `S3_SECRET`, `S3_TEST_BUCKET` | `S3_REGION` | — |
|
|
98
|
+
| `gateHelper.kubeGate()` | `KUBE_CONFIG`, `KUBE_TEST_OK` | — | — |
|
|
99
|
+
| `gateHelper.smtpGate()` | `SMTP_HOST`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`, `SMTP_TEST_TO` | `SMTP_PORT`, `SMTP_SECURE` | — |
|
|
100
|
+
|
|
101
|
+
The variables are documented in the workspace-root `.env.example`.
|
|
102
|
+
|
|
103
|
+
### Helpers
|
|
104
|
+
|
|
105
|
+
| Symbol | Purpose |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `gateHelper` (`createGateHelper()`) | The six gates above |
|
|
108
|
+
| `randomNamespace(prefix, length?)` | `<prefix>_<hex>`; default 6 hex characters |
|
|
109
|
+
| `cleanupHelper` (`createCleanupHelper()`) | `registerCleanup(fn)`, `runCleanups()` |
|
|
110
|
+
| `mongoGate`, `redisGate`, `postgresGate`, `smtpGate`, `registerCleanup`, `runCleanups` | Deprecated wrappers over `gateHelper` / `cleanupHelper` |
|
|
111
|
+
|
|
112
|
+
### Types
|
|
113
|
+
|
|
114
|
+
| Symbol | Purpose |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `IntegrationGate<E>` | `{ skip: boolean, reason?: string, env: Partial<E> }` |
|
|
117
|
+
| `MongoEnv`, `PostgresEnv`, `RedisEnv`, `S3Env`, `KubeEnv`, `SmtpEnv` | The variable set each gate reads |
|
|
118
|
+
| `GateHelper`, `CleanupHelper`, `CleanupFn`, `ProbeTarget` | Helper interfaces and the probe's `host:port` |
|
|
119
|
+
|
|
120
|
+
## Common pitfalls
|
|
121
|
+
|
|
122
|
+
- Using the global cleanup queue from two provisioning spec files — Bun runs them in one process, so
|
|
123
|
+
the first `afterAll` drops every namespace. Give each spec file its own namespace and teardown.
|
|
124
|
+
- `skip` is a plain boolean, so `env` stays `Partial<E>` on the open branch; read a required
|
|
125
|
+
variable with a cast.
|
|
126
|
+
- Awaiting a capability probe inside the suite — Bun picks `test` / `test.skip` synchronously; probe
|
|
127
|
+
with top-level `await` in `tests/context.ts`.
|
|
128
|
+
- An open SMTP gate sends real mail to `SMTP_TEST_TO`.
|
|
129
|
+
- A reachable datastore with a wrong password still opens the gate — the probe asks for a TCP
|
|
130
|
+
connect only, never a login.
|
|
131
|
+
- Never print a credential while wiring the variables.
|
|
132
|
+
|
|
133
|
+
## Related packages
|
|
11
134
|
|
|
12
|
-
|
|
135
|
+
- [`@owlmeans/test`](../test) — env loading and `makeGates` for providers outside these six services
|
|
136
|
+
- [`@owlmeans/test-auth`](../test-auth) — auth mocks for category-B unit tests
|
|
137
|
+
- [`@owlmeans/mongo-resource`](../mongo-resource), [`@owlmeans/postgres`](../postgres), [`@owlmeans/redis`](../redis) — consumers that own their drivers
|
|
138
|
+
- [`@owlmeans/log`](../log) — the logger the skip warnings and failed cleanups go to
|
|
13
139
|
|
|
14
140
|
<!-- owlmeans:agent-guidance:start -->
|
|
15
141
|
## Agent guidance
|
|
@@ -19,7 +145,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
19
145
|
your project's skill store (`.agents/skills/`):
|
|
20
146
|
|
|
21
147
|
```sh
|
|
22
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
148
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.52
|
|
23
149
|
```
|
|
24
150
|
|
|
25
151
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/test-integration",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-10-
|
|
4
|
+
"version": "0.1.18-rc.34",
|
|
5
|
+
"generatedAt": "2026-10-08T21:27:54.296Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -6,7 +6,7 @@ description: Category-C integration tests for OwlMeans Common packages that talk
|
|
|
6
6
|
|
|
7
7
|
# Integration Tests — Category C
|
|
8
8
|
|
|
9
|
-
**Install:** `"@owlmeans/test-integration": "^0.1.18-rc.
|
|
9
|
+
**Install:** `"@owlmeans/test-integration": "^0.1.18-rc.34"` in `devDependencies`
|
|
10
10
|
|
|
11
11
|
Category C applies to packages that integrate with external services: `postgres`,
|
|
12
12
|
`postgres-resource`, `mongo`, `mongo-resource`, `redis`, `redis-resource`, `redis-queue`,
|
|
@@ -25,29 +25,29 @@ service hands it is category C even when it names no driver of its own.
|
|
|
25
25
|
|
|
26
26
|
| Helper | Purpose |
|
|
27
27
|
|---|---|
|
|
28
|
-
| `postgresGate()`,
|
|
28
|
+
| `gateHelper` — `.postgresGate()`, `.mongoGate()`, `.redisGate()`, `.s3Gate()`, `.kubeGate()`, `.smtpGate()` | Read env (and, for the three datastores, probe the address — below), return `IntegrationGate<E>` = `{ skip, reason?, env }`. |
|
|
29
29
|
| `IntegrationGate<E>` | `{ skip: boolean, reason?: string, env: Partial<E> }`. `env` holds only the variables that were actually populated. `skip` is a plain `boolean`, not a discriminant, so `env` stays `Partial<E>` on the open branch too — a suite reads a required variable through a cast: `gate.env.MONGO_URL as string`. |
|
|
30
30
|
| `PostgresEnv`, `MongoEnv`, `RedisEnv`, `S3Env`, `KubeEnv`, `SmtpEnv` | The variable set each gate reads, so `tests/context.ts` types its exported gate. |
|
|
31
31
|
| `randomNamespace(prefix, len?)` | Schema / DB / key / object-prefix namespacing for parallel-safe runs. Default 6 hex chars. |
|
|
32
|
-
| `registerCleanup(fn)` +
|
|
32
|
+
| `cleanupHelper.registerCleanup(fn)` + `.runCleanups()` | Process-global LIFO queue. Only where **one** spec file of the package provisions anything — see below. |
|
|
33
33
|
|
|
34
34
|
Each gate fails closed on its **required** variables and treats the rest as optional:
|
|
35
35
|
|
|
36
36
|
| Gate | Required | Optional |
|
|
37
37
|
|---|---|---|
|
|
38
|
-
| `mongoGate()` | `MONGO_URL` | `MONGO_TEST_DB_PREFIX` |
|
|
39
|
-
| `postgresGate()` | `POSTGRES_URL` | `POSTGRES_TEST_DB_PREFIX` |
|
|
40
|
-
| `redisGate()` | `REDIS_URL` | `REDIS_TEST_KEY_PREFIX` |
|
|
41
|
-
| `s3Gate()` | `S3_ENDPOINT`, `S3_KEY`, `S3_SECRET`, `S3_TEST_BUCKET` | `S3_REGION` |
|
|
42
|
-
| `kubeGate()` | `KUBE_CONFIG`, `KUBE_TEST_OK` | — |
|
|
43
|
-
| `smtpGate()` | `SMTP_HOST`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`, `SMTP_TEST_TO` | `SMTP_PORT`, `SMTP_SECURE` |
|
|
38
|
+
| `gateHelper.mongoGate()` | `MONGO_URL` | `MONGO_TEST_DB_PREFIX` |
|
|
39
|
+
| `gateHelper.postgresGate()` | `POSTGRES_URL` | `POSTGRES_TEST_DB_PREFIX` |
|
|
40
|
+
| `gateHelper.redisGate()` | `REDIS_URL` | `REDIS_TEST_KEY_PREFIX` |
|
|
41
|
+
| `gateHelper.s3Gate()` | `S3_ENDPOINT`, `S3_KEY`, `S3_SECRET`, `S3_TEST_BUCKET` | `S3_REGION` |
|
|
42
|
+
| `gateHelper.kubeGate()` | `KUBE_CONFIG`, `KUBE_TEST_OK` | — |
|
|
43
|
+
| `gateHelper.smtpGate()` | `SMTP_HOST`, `SMTP_USER`, `SMTP_PASSWORD`, `SMTP_FROM`, `SMTP_TEST_TO` | `SMTP_PORT`, `SMTP_SECURE` |
|
|
44
44
|
|
|
45
45
|
`SMTP_TEST_TO` is required rather than optional because an open SMTP gate sends **real mail** — the
|
|
46
46
|
suite must never guess a recipient.
|
|
47
47
|
|
|
48
48
|
### A datastore gate also asks whether the server answers
|
|
49
49
|
|
|
50
|
-
`mongoGate()`,
|
|
50
|
+
`gateHelper.mongoGate()`, `.redisGate()` and `.postgresGate()` open only when their connection string is set
|
|
51
51
|
**and** one of the hosts in it accepts a TCP connect (default ports 27017 / 6379 / 5432). A local
|
|
52
52
|
`.env` keeps the port-forward address long after the forward is gone, and a gate that trusted the
|
|
53
53
|
variable alone left `beforeAll` to spend its whole budget on `ECONNREFUSED` and fail the suite. An
|
|
@@ -64,12 +64,12 @@ Bun decides `test` vs `test.skip` synchronously and every consumer reads its gat
|
|
|
64
64
|
so no `tests/context.ts` changes to get it. It is TCP only: no driver and no login, so a wrong
|
|
65
65
|
password still opens the gate and fails in the suite, where it belongs. It answers "reachable" when
|
|
66
66
|
it cannot tell — an SRV (`mongodb+srv://`) or unix-socket address, a string it cannot parse, a probe
|
|
67
|
-
that cannot spawn — which is exactly the behaviour a gate had before it probed. `s3Gate()`,
|
|
68
|
-
|
|
67
|
+
that cannot spawn — which is exactly the behaviour a gate had before it probed. `gateHelper.s3Gate()`,
|
|
68
|
+
`.kubeGate()` and `.smtpGate()` do not probe: they name remote services, not a local forward.
|
|
69
69
|
|
|
70
70
|
An optional variable is only in `env` when it was actually populated, which is why a suite reads a
|
|
71
71
|
defaulted one — `POSTGRES_TEST_DB_PREFIX ?? 'omt'` — straight from `process.env` instead: calling
|
|
72
|
-
any gate has already run `loadEnv`, so the `.env` values are in `process.env` by then.
|
|
72
|
+
any gate has already run `envHelper.loadEnv`, so the `.env` values are in `process.env` by then.
|
|
73
73
|
|
|
74
74
|
**Six services, six gates — a category-C package outside that set writes its own.** There is no
|
|
75
75
|
gate for an LLM provider or for the Mailgun HTTP API, and none should be added to
|
|
@@ -90,7 +90,7 @@ asserts on the request it builds and the API's reply.
|
|
|
90
90
|
## Env contract
|
|
91
91
|
|
|
92
92
|
One `.env.example` at the workspace root documents every variable, grouped by service, with
|
|
93
|
-
comments; the `.env` beside it supplies real values for local runs and `loadEnv` (from
|
|
93
|
+
comments; the `.env` beside it supplies real values for local runs and `envHelper.loadEnv` (from
|
|
94
94
|
`@owlmeans/test`) picks it up. CI sets the same variables from secrets. **Empty value = skip, and
|
|
95
95
|
so is a datastore address nothing answers at** — never a failure. A developer's `.env` may keep the
|
|
96
96
|
port-forward address permanently: with the forward up the suites run, without it they skip.
|
|
@@ -143,7 +143,7 @@ A resource package (`*-resource`) owns the `Resource<T>` contract; the db packag
|
|
|
143
143
|
translation — live in the **resource** package and gate on nothing: they leave the process
|
|
144
144
|
alone. `@owlmeans/postgres-resource` is entirely this shape.
|
|
145
145
|
- **Raw-driver specs** belong there too when the subject is the round trip and not the service.
|
|
146
|
-
`@owlmeans/mongo-resource` opens `mongoGate()`, derives a namespaced database with
|
|
146
|
+
`@owlmeans/mongo-resource` opens `gateHelper.mongoGate()`, derives a namespaced database with
|
|
147
147
|
`randomNamespace`, registers a cleanup that drops it, and drives `mongodb` directly with the
|
|
148
148
|
driver as its own devDependency — legitimate precisely because it never constructs the db
|
|
149
149
|
service. It is also the one package that may use the global cleanup queue, because only that
|
|
@@ -156,10 +156,10 @@ A resource package (`*-resource`) owns the `Resource<T>` contract; the db packag
|
|
|
156
156
|
## Per-suite namespaces, not the global cleanup queue
|
|
157
157
|
|
|
158
158
|
Bun runs **every spec file of a package in one process** with one shared module registry, and the
|
|
159
|
-
queue is one array for that whole process. A process-global `registerCleanup
|
|
159
|
+
queue is one array for that whole process. A process-global `cleanupHelper.registerCleanup`/`.runCleanups()`
|
|
160
160
|
therefore misfires as soon as two spec files provision: the first to reach `afterAll` drains the
|
|
161
161
|
entire queue and drops the namespaces of the files still to come. The queue is safe only where a
|
|
162
|
-
**single** spec file provisions anything and that same file calls `runCleanups()`. That is the
|
|
162
|
+
**single** spec file provisions anything and that same file calls `cleanupHelper.runCleanups()`. That is the
|
|
163
163
|
shape `@owlmeans/mongo-resource` has — one gated round-trip spec registering one dropped database,
|
|
164
164
|
beside two ungated spec files that translate criteria and references in memory and open nothing.
|
|
165
165
|
|
|
@@ -168,7 +168,7 @@ own teardown instead:
|
|
|
168
168
|
|
|
169
169
|
```ts
|
|
170
170
|
// tests/context.ts
|
|
171
|
-
export const gate: IntegrationGate<PostgresEnv> = postgresGate()
|
|
171
|
+
export const gate: IntegrationGate<PostgresEnv> = gateHelper.postgresGate()
|
|
172
172
|
|
|
173
173
|
export const makeSuite = (label: string): PgSuite => {
|
|
174
174
|
const prefix = process.env.POSTGRES_TEST_DB_PREFIX ?? 'omt'
|
|
@@ -228,7 +228,7 @@ maker that runs more than once for the same alias re-declares the same entries a
|
|
|
228
228
|
A `boot()` builds a whole new context, but the declarations belong to the module registry rather
|
|
229
229
|
than to any context, so they carry across every boot in the process — deliberately.
|
|
230
230
|
Never reset them inside a shared `boot()` helper: a `.migration()` registered before the boot
|
|
231
|
-
would be silently dropped. A spec that wants a clean slate calls `resetDeclarations(alias)`
|
|
231
|
+
would be silently dropped. A spec that wants a clean slate calls `pgDeclarationHelper.resetDeclarations(alias)` (or `mongoDeclarationHelper`'s)
|
|
232
232
|
itself, which is what a spec simulating a restarted process should have to say out loud.
|
|
233
233
|
|
|
234
234
|
Migration bodies belong at **module scope**, not inside the spec callback: the checksum
|
|
@@ -275,11 +275,11 @@ devDependencies.
|
|
|
275
275
|
|
|
276
276
|
**Nothing auto-loads the workspace `.env`.** Bun reads a `.env` beside the working directory, so
|
|
277
277
|
`bun test` inside a package never sees the one at the workspace root. The gates work because
|
|
278
|
-
`@owlmeans/test`'s `loadEnv` does the loading itself and every gate calls it before reading a
|
|
278
|
+
`@owlmeans/test`'s `envHelper.loadEnv` does the loading itself and every gate calls it before reading a
|
|
279
279
|
variable: it walks up from the working directory for a `bun.lock`, or for a `package.json`
|
|
280
280
|
sitting beside a directory named `packages`, and reads the `.env` it finds there. A variable
|
|
281
281
|
already set to a non-empty value always wins, so `MONGO_URL=… bun test ./tests` still overrides
|
|
282
|
-
the file. A workspace shaped any other way names the file itself — `loadEnv({ file })` at the top
|
|
282
|
+
the file. A workspace shaped any other way names the file itself — `envHelper.loadEnv({ file })` at the top
|
|
283
283
|
of `tests/context.ts`, before the gates run.
|
|
284
284
|
|
|
285
285
|
Bun's per-test timeout is 5s, and **`bunfig.toml`'s `[test] timeout` does not raise it** — bun
|
|
@@ -301,7 +301,7 @@ bun test --timeout=60000 ./tests
|
|
|
301
301
|
value instead, which also proves the call returned:
|
|
302
302
|
|
|
303
303
|
```ts
|
|
304
|
-
expect(pgErrorToResourceError(circular)).toBe(circular) // not: expect(() => …).not.toThrow()
|
|
304
|
+
expect(pgErrorHelper.pgErrorToResourceError(circular)).toBe(circular) // not: expect(() => …).not.toThrow()
|
|
305
305
|
```
|
|
306
306
|
|
|
307
307
|
## Rules
|
|
@@ -320,5 +320,5 @@ expect(pgErrorToResourceError(circular)).toBe(circular) // not: expect(() =>
|
|
|
320
320
|
## When the env is partially populated
|
|
321
321
|
|
|
322
322
|
Each gate fails closed. A test that needs both `S3_KEY` and `S3_SECRET` does not run if only
|
|
323
|
-
one is set — `s3Gate()` reports `skip: true`. This is intentional: a half-configured
|
|
323
|
+
one is set — `gateHelper.s3Gate()` reports `skip: true`. This is intentional: a half-configured
|
|
324
324
|
environment must not produce false positives or partial coverage.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface CleanupFn {
|
|
2
|
+
(): void | Promise<void>;
|
|
3
|
+
}
|
|
4
|
+
/** The opt-in teardown queue a suite's `tests/context.ts` fills and its `afterAll` drains. */
|
|
5
|
+
export interface CleanupHelper {
|
|
6
|
+
/**
|
|
7
|
+
* Register a cleanup function that {@link CleanupHelper.runCleanups} will execute (LIFO).
|
|
8
|
+
* Use from `tests/context.ts` `setup()` to schedule teardown of resources
|
|
9
|
+
* that were provisioned for the suite (DB drop, key namespace flush,
|
|
10
|
+
* uploaded objects).
|
|
11
|
+
*/
|
|
12
|
+
registerCleanup: (fn: CleanupFn) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Run all pending cleanup functions in reverse registration order.
|
|
15
|
+
* Errors are swallowed and logged as warnings so a failing cleanup
|
|
16
|
+
* cannot mask a test failure.
|
|
17
|
+
*/
|
|
18
|
+
runCleanups: () => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cleanup/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IAAG,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE;AAEvD,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,eAAe,EAAE,CAAC,EAAE,EAAE,SAAS,KAAK,IAAI,CAAA;IACxC;;;;OAIG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cleanup/types.ts"],"names":[],"mappings":""}
|
package/build/cleanup.d.ts
CHANGED
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import type { CleanupFn } from './types.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* that were provisioned for the suite (DB drop, key namespace flush,
|
|
6
|
-
* uploaded objects).
|
|
7
|
-
*/
|
|
1
|
+
import type { CleanupFn, CleanupHelper } from './cleanup/types.js';
|
|
2
|
+
export declare const createCleanupHelper: () => CleanupHelper;
|
|
3
|
+
export declare const cleanupHelper: CleanupHelper;
|
|
4
|
+
/** @deprecated compat:factory-refactor — use `cleanupHelper.registerCleanup(…)` */
|
|
8
5
|
export declare const registerCleanup: (fn: CleanupFn) => void;
|
|
9
|
-
/**
|
|
10
|
-
* Run all pending cleanup functions in reverse registration order.
|
|
11
|
-
* Errors are swallowed and logged as warnings so a failing cleanup
|
|
12
|
-
* cannot mask a test failure.
|
|
13
|
-
*/
|
|
6
|
+
/** @deprecated compat:factory-refactor — use `cleanupHelper.runCleanups()` */
|
|
14
7
|
export declare const runCleanups: () => Promise<void>;
|
|
15
8
|
//# sourceMappingURL=cleanup.d.ts.map
|
package/build/cleanup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAOlE,eAAO,MAAM,mBAAmB,QAAO,aAkBtC,CAAA;AAED,eAAO,MAAM,aAAa,eAAwB,CAAA;AAElD,mFAAmF;AACnF,eAAO,MAAM,eAAe,OAAQ,SAAS,KAAG,IAAyC,CAAA;AAEzF,8EAA8E;AAC9E,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,IAAI,CAAsC,CAAA"}
|
package/build/cleanup.js
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import { logger } from '@owlmeans/log';
|
|
2
2
|
const log = logger('test-integration');
|
|
3
|
+
// Process-wide on purpose: every spec file of a run registers into, and drains, the same queue.
|
|
3
4
|
const queue = [];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
while (queue.length > 0) {
|
|
20
|
-
const fn = queue.pop();
|
|
21
|
-
if (fn == null)
|
|
22
|
-
continue;
|
|
23
|
-
try {
|
|
24
|
-
await fn();
|
|
25
|
-
}
|
|
26
|
-
catch (err) {
|
|
27
|
-
log.warn('Cleanup failed', err);
|
|
5
|
+
export const createCleanupHelper = () => {
|
|
6
|
+
const registerCleanup = (fn) => {
|
|
7
|
+
queue.push(fn);
|
|
8
|
+
};
|
|
9
|
+
const runCleanups = async () => {
|
|
10
|
+
while (queue.length > 0) {
|
|
11
|
+
const fn = queue.pop();
|
|
12
|
+
if (fn == null)
|
|
13
|
+
continue;
|
|
14
|
+
try {
|
|
15
|
+
await fn();
|
|
16
|
+
}
|
|
17
|
+
catch (err) {
|
|
18
|
+
log.warn('Cleanup failed', err);
|
|
19
|
+
}
|
|
28
20
|
}
|
|
29
|
-
}
|
|
21
|
+
};
|
|
22
|
+
return { registerCleanup, runCleanups };
|
|
30
23
|
};
|
|
24
|
+
export const cleanupHelper = createCleanupHelper();
|
|
25
|
+
/** @deprecated compat:factory-refactor — use `cleanupHelper.registerCleanup(…)` */
|
|
26
|
+
export const registerCleanup = (fn) => cleanupHelper.registerCleanup(fn);
|
|
27
|
+
/** @deprecated compat:factory-refactor — use `cleanupHelper.runCleanups()` */
|
|
28
|
+
export const runCleanups = async () => await cleanupHelper.runCleanups();
|
|
31
29
|
//# sourceMappingURL=cleanup.js.map
|
package/build/cleanup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAEtC,MAAM,KAAK,GAAgB,EAAE,CAAA;AAE7B
|
|
1
|
+
{"version":3,"file":"cleanup.js","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA;AAEtC,gGAAgG;AAChG,MAAM,KAAK,GAAgB,EAAE,CAAA;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAkB,EAAE;IACrD,MAAM,eAAe,GAAG,CAAC,EAAa,EAAQ,EAAE;QAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAChB,CAAC,CAAA;IAED,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE;QAC5C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;YACtB,IAAI,EAAE,IAAI,IAAI;gBAAE,SAAQ;YACxB,IAAI,CAAC;gBACH,MAAM,EAAE,EAAE,CAAA;YACZ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,GAAG,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAA;YACjC,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA;AACzC,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,EAAE,CAAA;AAElD,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAa,EAAQ,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,CAAC,CAAA;AAEzF,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,IAAmB,EAAE,CAAC,MAAM,aAAa,CAAC,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IntegrationGate, KubeEnv, MongoEnv, PostgresEnv, RedisEnv, S3Env, SmtpEnv } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The env gates of the integration suites: each reads the variables documented in `.env.example`
|
|
4
|
+
* and answers `{ skip, reason?, env }`, so a `tests/context.ts` decides whether to register the
|
|
5
|
+
* real service and a spec self-skips when it is missing.
|
|
6
|
+
*/
|
|
7
|
+
export interface GateHelper {
|
|
8
|
+
/** `MONGO_URL` set AND a host in it accepting a TCP connect; `MONGO_TEST_DB_PREFIX` optional. */
|
|
9
|
+
mongoGate: () => IntegrationGate<MongoEnv>;
|
|
10
|
+
/** `REDIS_URL` set AND a host in it accepting a TCP connect; `REDIS_TEST_KEY_PREFIX` optional. */
|
|
11
|
+
redisGate: () => IntegrationGate<RedisEnv>;
|
|
12
|
+
s3Gate: () => IntegrationGate<S3Env>;
|
|
13
|
+
kubeGate: () => IntegrationGate<KubeEnv>;
|
|
14
|
+
/** `POSTGRES_URL` set AND a host in it accepting a TCP connect; `POSTGRES_TEST_DB_PREFIX` optional. */
|
|
15
|
+
postgresGate: () => IntegrationGate<PostgresEnv>;
|
|
16
|
+
smtpGate: () => IntegrationGate<SmtpEnv>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gates/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE5G;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,iGAAiG;IACjG,SAAS,EAAE,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC1C,kGAAkG;IAClG,SAAS,EAAE,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAA;IAC1C,MAAM,EAAE,MAAM,eAAe,CAAC,KAAK,CAAC,CAAA;IACpC,QAAQ,EAAE,MAAM,eAAe,CAAC,OAAO,CAAC,CAAA;IACxC,uGAAuG;IACvG,YAAY,EAAE,MAAM,eAAe,CAAC,WAAW,CAAC,CAAA;IAChD,QAAQ,EAAE,MAAM,eAAe,CAAC,OAAO,CAAC,CAAA;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/gates/types.ts"],"names":[],"mappings":""}
|
package/build/gates.d.ts
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import type { IntegrationGate,
|
|
1
|
+
import type { IntegrationGate, MongoEnv, PostgresEnv, RedisEnv, SmtpEnv } from './types.js';
|
|
2
|
+
import type { GateHelper } from './gates/types.js';
|
|
3
|
+
export declare const createGateHelper: () => GateHelper;
|
|
4
|
+
export declare const gateHelper: GateHelper;
|
|
5
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.mongoGate()` */
|
|
2
6
|
export declare const mongoGate: () => IntegrationGate<MongoEnv>;
|
|
7
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.redisGate()` */
|
|
3
8
|
export declare const redisGate: () => IntegrationGate<RedisEnv>;
|
|
4
|
-
|
|
5
|
-
export declare const kubeGate: () => IntegrationGate<KubeEnv>;
|
|
9
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.postgresGate()` */
|
|
6
10
|
export declare const postgresGate: () => IntegrationGate<PostgresEnv>;
|
|
11
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.smtpGate()` */
|
|
7
12
|
export declare const smtpGate: () => IntegrationGate<SmtpEnv>;
|
|
8
13
|
//# sourceMappingURL=gates.d.ts.map
|
package/build/gates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAW,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAS,OAAO,EAAE,MAAM,YAAY,CAAA;AAC3G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,eAAO,MAAM,gBAAgB,QAAO,UAiDnC,CAAA;AAED,eAAO,MAAM,UAAU,YAAqB,CAAA;AAE5C,yEAAyE;AACzE,eAAO,MAAM,SAAS,QAAO,eAAe,CAAC,QAAQ,CAA2B,CAAA;AAEhF,yEAAyE;AACzE,eAAO,MAAM,SAAS,QAAO,eAAe,CAAC,QAAQ,CAA2B,CAAA;AAEhF,4EAA4E;AAC5E,eAAO,MAAM,YAAY,QAAO,eAAe,CAAC,WAAW,CAA8B,CAAA;AAEzF,wEAAwE;AACxE,eAAO,MAAM,QAAQ,QAAO,eAAe,CAAC,OAAO,CAA0B,CAAA"}
|
package/build/gates.js
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { envHelper } from '@owlmeans/test';
|
|
2
|
+
import { reachabilityUtils } from './reachability.js';
|
|
3
|
+
export const createGateHelper = () => {
|
|
4
|
+
const collect = (keys) => {
|
|
5
|
+
const env = {};
|
|
6
|
+
for (const k of keys) {
|
|
7
|
+
if (envHelper.hasEnv(k))
|
|
8
|
+
env[k] = process.env[k];
|
|
9
|
+
}
|
|
10
|
+
return env;
|
|
11
|
+
};
|
|
12
|
+
const toIntegrationGate = (required, optional = [], reachable) => {
|
|
13
|
+
const gate = envHelper.requireEnv(required);
|
|
14
|
+
const env = collect([...required, ...optional]);
|
|
15
|
+
if (!('ok' in gate))
|
|
16
|
+
return { skip: true, reason: gate.reason, env };
|
|
17
|
+
if (reachable != null) {
|
|
18
|
+
const reason = reachabilityUtils.unreachableReason(reachable.key, process.env[reachable.key], reachable.defaultPort);
|
|
19
|
+
if (reason != null)
|
|
20
|
+
return { skip: true, reason, env };
|
|
21
|
+
}
|
|
22
|
+
return { skip: false, env };
|
|
23
|
+
};
|
|
24
|
+
const mongoGate = () => toIntegrationGate(['MONGO_URL'], ['MONGO_TEST_DB_PREFIX'], { key: 'MONGO_URL', defaultPort: 27017 });
|
|
25
|
+
const redisGate = () => toIntegrationGate(['REDIS_URL'], ['REDIS_TEST_KEY_PREFIX'], { key: 'REDIS_URL', defaultPort: 6379 });
|
|
26
|
+
const s3Gate = () => toIntegrationGate(['S3_ENDPOINT', 'S3_KEY', 'S3_SECRET', 'S3_TEST_BUCKET'], ['S3_REGION']);
|
|
27
|
+
const kubeGate = () => toIntegrationGate(['KUBE_CONFIG', 'KUBE_TEST_OK']);
|
|
28
|
+
const postgresGate = () => toIntegrationGate(['POSTGRES_URL'], ['POSTGRES_TEST_DB_PREFIX'], { key: 'POSTGRES_URL', defaultPort: 5432 });
|
|
29
|
+
const smtpGate = () => toIntegrationGate(['SMTP_HOST', 'SMTP_USER', 'SMTP_PASSWORD', 'SMTP_FROM', 'SMTP_TEST_TO'], ['SMTP_PORT', 'SMTP_SECURE']);
|
|
30
|
+
return { mongoGate, redisGate, s3Gate, kubeGate, postgresGate, smtpGate };
|
|
10
31
|
};
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return { skip: false, env };
|
|
22
|
-
};
|
|
23
|
-
export const mongoGate = () => toIntegrationGate(['MONGO_URL'], ['MONGO_TEST_DB_PREFIX'], { key: 'MONGO_URL', defaultPort: 27017 });
|
|
24
|
-
export const redisGate = () => toIntegrationGate(['REDIS_URL'], ['REDIS_TEST_KEY_PREFIX'], { key: 'REDIS_URL', defaultPort: 6379 });
|
|
25
|
-
export const s3Gate = () => toIntegrationGate(['S3_ENDPOINT', 'S3_KEY', 'S3_SECRET', 'S3_TEST_BUCKET'], ['S3_REGION']);
|
|
26
|
-
export const kubeGate = () => toIntegrationGate(['KUBE_CONFIG', 'KUBE_TEST_OK']);
|
|
27
|
-
export const postgresGate = () => toIntegrationGate(['POSTGRES_URL'], ['POSTGRES_TEST_DB_PREFIX'], { key: 'POSTGRES_URL', defaultPort: 5432 });
|
|
28
|
-
export const smtpGate = () => toIntegrationGate(['SMTP_HOST', 'SMTP_USER', 'SMTP_PASSWORD', 'SMTP_FROM', 'SMTP_TEST_TO'], ['SMTP_PORT', 'SMTP_SECURE']);
|
|
32
|
+
export const gateHelper = createGateHelper();
|
|
33
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.mongoGate()` */
|
|
34
|
+
export const mongoGate = () => gateHelper.mongoGate();
|
|
35
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.redisGate()` */
|
|
36
|
+
export const redisGate = () => gateHelper.redisGate();
|
|
37
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.postgresGate()` */
|
|
38
|
+
export const postgresGate = () => gateHelper.postgresGate();
|
|
39
|
+
/** @deprecated compat:factory-refactor — use `gateHelper.smtpGate()` */
|
|
40
|
+
export const smtpGate = () => gateHelper.smtpGate();
|
|
29
41
|
//# sourceMappingURL=gates.js.map
|
package/build/gates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"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"}
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,mBAAmB,kBAAkB,CAAA;AACrC,mBAAmB,YAAY,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,mBAAmB,oBAAoB,CAAA"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAG1B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
|