@stardeck-customer-apps/testing 0.5.0 → 0.5.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/SKILL.md CHANGED
@@ -53,7 +53,7 @@ beforeEach(() => app.reset());
53
53
  afterAll(() => app.close());
54
54
 
55
55
  describeWorkflow("checkout", () => {
56
- it("completes an order, decrements stock, and emails the customer", async () => {
56
+ it("someone buys a widget and gets a confirmation email", async () => {
57
57
  const user = app.asUser({ email: "buyer@example.com" });
58
58
 
59
59
  const res = await callRoute(checkout, { body: { items: [{ sku: "Widget", qty: 2 }] } });
@@ -153,6 +153,23 @@ expect(app.edge.latestDisplay()?.action).toBe("show");
153
153
  ("checkout", "booking", "inventory"). The platform reports these per
154
154
  deployment — every critical workflow should have one.
155
155
 
156
+ ### Naming
157
+
158
+ The app owner reads these names in the dashboard, under the workflow, without
159
+ ever opening the code. Name the workflow after the business capability, and name
160
+ each test after the thing a person does, in a full sentence:
161
+
162
+ ```ts
163
+ describeWorkflow("checkout", () => {
164
+ it("someone adds an item to their cart", ...);
165
+ it("someone pays for their cart with a credit card", ...);
166
+ it("someone whose card is declined keeps their cart", ...);
167
+ });
168
+ ```
169
+
170
+ Not `it("POST /api/checkout returns 200")` or `it("decrements stock")` — those
171
+ describe the code, and the owner can't tell from them what is or isn't covered.
172
+
156
173
  ## What works out of the box
157
174
 
158
175
  - `DataStoreClient` (query/insert/update/delete/schema ops) — served by the
package/dist/index.d.mts CHANGED
@@ -353,6 +353,10 @@ declare function createTestApp(options?: TestAppOptions): Promise<TestApp>;
353
353
  * "booking", "inventory"). The platform parses the `workflow:` prefix out of
354
354
  * test reporter output to show per-workflow pass/fail on deployments — use
355
355
  * one block per workflow the app's owner cares about.
356
+ *
357
+ * The dashboard lists the workflow's test names beneath it, so title each test
358
+ * as a sentence about what a person does ("someone pays with a credit card"),
359
+ * not about the code under it.
356
360
  */
357
361
  declare function describeWorkflow(name: string, fn: () => void): void;
358
362
  declare const WORKFLOW_NAME_PREFIX = "workflow:";
package/dist/index.d.ts CHANGED
@@ -353,6 +353,10 @@ declare function createTestApp(options?: TestAppOptions): Promise<TestApp>;
353
353
  * "booking", "inventory"). The platform parses the `workflow:` prefix out of
354
354
  * test reporter output to show per-workflow pass/fail on deployments — use
355
355
  * one block per workflow the app's owner cares about.
356
+ *
357
+ * The dashboard lists the workflow's test names beneath it, so title each test
358
+ * as a sentence about what a person does ("someone pays with a credit card"),
359
+ * not about the code under it.
356
360
  */
357
361
  declare function describeWorkflow(name: string, fn: () => void): void;
358
362
  declare const WORKFLOW_NAME_PREFIX = "workflow:";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stardeck-customer-apps/testing",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Vitest test harness for Stardeck customer apps — in-process Postgres (PGlite) plus a control-plane simulator so the real Stardeck SDKs run unmodified in tests",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",