@mozaik-ai/core 3.12.0 → 3.13.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mozaik-ai/core",
3
- "version": "3.12.0",
3
+ "version": "3.13.0",
4
4
  "description": "A TypeScript framework for building reactive agents",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -0,0 +1,31 @@
1
+ # Tests
2
+
3
+ Mozaik's test suite is split into two layers, runnable independently.
4
+
5
+ | Command | Runs | Scope |
6
+ | --- | --- | --- |
7
+ | `npm run test:unit` | `tests/unit/**` | Domain + application logic in isolation. External dependencies are mocked through their domain ports. |
8
+ | `npm run test:integration` | `tests/integration/**` | Infrastructure layer — concrete provider runtimes (Anthropic Messages, OpenAI Responses, OpenAI-compatible Chat Completions, Gemini generateContent) and the in-memory repository. |
9
+ | `npm test` | everything | Full suite. |
10
+ | `npm run test:coverage` | everything | Adds an Istanbul coverage report under `coverage/`. |
11
+
12
+ ## Integration tests do not make network calls
13
+
14
+ Provider runtimes are exercised through their **pure conversion methods**
15
+ (`mapContextToRequest`, `buildRequest`, `extractContextItems`,
16
+ `extractTokenUsage`) — a `ModelContext` of domain items in, a provider-shaped
17
+ request out, and a provider response back into domain items. This is the part
18
+ of the infrastructure layer that breaks silently in production (a malformed
19
+ tool-call shape → a 400 from the provider), so it is asserted exactly without
20
+ touching the wire.
21
+
22
+ `tests/setup.ts` seeds dummy provider API keys so the SDK clients can be
23
+ constructed in CI without real secrets. **Tests must never make a real API
24
+ call** — stub the SDK client if you need to exercise `infer()`/`stream()`
25
+ end to end.
26
+
27
+ ## Shared helpers
28
+
29
+ `tests/helpers/` holds reusable doubles (e.g. `RecordingParticipant`, a fake
30
+ `GenerativeModel`). They are excluded from the suite glob, so they are not run
31
+ as test files.