From 9f5792c1c5234e7ef831bc8ebc77a8eb9cb15fe3 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 6 Sep 2026 16:48:26 -0500 Subject: [PATCH] test(mesh): steps-only exports across Deno, Bun and the edge Deno and Bun mesh fixtures still exported a @Provider, which now throws at boot. Convert each to a @Step (provide() -> run(), move the class from providers: [] to steps: []) so the fixtures build a graph the current mesh actually allows. test/edge/_worker.mjs is a gitignored esbuild bundle rebuilt by test/edge/run.ts on every test:edge run, so no source change was needed there once the fixtures matched. All four suites pass: vitest (Node), deno test, bun test, and the workerd/miniflare edge run, plus typecheck. Signed-off-by: Diego Resendez --- test/bun/mesh-reconnect.test.ts | 8 ++++---- test/bun/mesh.test.ts | 8 ++++---- test/deno/mesh-interop.test.ts | 8 ++++---- test/deno/mesh-reconnect.test.ts | 8 ++++---- test/deno/mesh.test.ts | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/bun/mesh-reconnect.test.ts b/test/bun/mesh-reconnect.test.ts index 7fc379b..cdb2e8c 100644 --- a/test/bun/mesh-reconnect.test.ts +++ b/test/bun/mesh-reconnect.test.ts @@ -8,14 +8,14 @@ // Run with: npm run test:bun import 'reflect-metadata'; import { test, expect } from 'bun:test'; -import { createApp, Provider, Step, Route, Get, Module, needs } from '../../src/index.ts'; +import { createApp, Step, Route, Get, Module, needs } from '../../src/index.ts'; import { serveBun } from '../../src/bun.ts'; const SECRET = 's3cr3t'; -@Provider({ provides: 'config', export: true }) +@Step({ provides: 'config', needs: [], export: true }) class Config { - provide() { + run() { return { config: { runtime: 'bun' } }; } } @@ -25,7 +25,7 @@ class Auth { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } -@Module({ mountpoint: '/api', providers: [Config], steps: [Auth] }) +@Module({ mountpoint: '/api', steps: [Config, Auth] }) class TeapotModule {} @Route('/local') diff --git a/test/bun/mesh.test.ts b/test/bun/mesh.test.ts index 136a496..a5b2234 100644 --- a/test/bun/mesh.test.ts +++ b/test/bun/mesh.test.ts @@ -8,14 +8,14 @@ // Run with: npm run test:bun import 'reflect-metadata'; import { test, expect } from 'bun:test'; -import { createApp, Provider, Step, Route, Get, Module, needs } from '../../src/index.ts'; +import { createApp, Step, Route, Get, Module, needs } from '../../src/index.ts'; import { serveBun } from '../../src/bun.ts'; const SECRET = 's3cr3t'; -@Provider({ provides: 'config', export: true }) +@Step({ provides: 'config', needs: [], export: true }) class Config { - provide() { + run() { return { config: { region: 'mx', runtime: 'bun' } }; } } @@ -25,7 +25,7 @@ class Auth { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } -@Module({ mountpoint: '/api', providers: [Config], steps: [Auth] }) +@Module({ mountpoint: '/api', steps: [Config, Auth] }) class TeapotModule {} @Route('/local') diff --git a/test/deno/mesh-interop.test.ts b/test/deno/mesh-interop.test.ts index 9fae7d4..47f94ff 100644 --- a/test/deno/mesh-interop.test.ts +++ b/test/deno/mesh-interop.test.ts @@ -10,14 +10,14 @@ // Run with: npm run test:deno (needs --allow-run to spawn the Node peer) import 'npm:reflect-metadata'; import { assertEquals, assertStringIncludes } from 'jsr:@std/assert'; -import { createApp, Provider, Step, Route, Get, Module, needs } from '../../src/index.ts'; +import { createApp, Step, Route, Get, Module, needs } from '../../src/index.ts'; const SECRET = 's3cr3t'; const NODE_PEER = 'test/interop/_node-peer.ts'; -@Provider({ provides: 'config', export: true }) +@Step({ provides: 'config', needs: [], export: true }) class Config { - provide() { + run() { return { config: { region: 'mx', runtime: 'deno' } }; } } @@ -27,7 +27,7 @@ class Auth { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } -@Module({ mountpoint: '/api', providers: [Config], steps: [Auth] }) +@Module({ mountpoint: '/api', steps: [Config, Auth] }) class TeapotModule {} @Route('/local') diff --git a/test/deno/mesh-reconnect.test.ts b/test/deno/mesh-reconnect.test.ts index daaafd1..7b031e6 100644 --- a/test/deno/mesh-reconnect.test.ts +++ b/test/deno/mesh-reconnect.test.ts @@ -7,14 +7,14 @@ // Run with: npm run test:deno import 'npm:reflect-metadata'; import { assertEquals } from 'jsr:@std/assert'; -import { createApp, Provider, Step, Route, Get, Module, needs } from '../../src/index.ts'; +import { createApp, Step, Route, Get, Module, needs } from '../../src/index.ts'; import { serveDeno } from '../../src/deno.ts'; const SECRET = 's3cr3t'; -@Provider({ provides: 'config', export: true }) +@Step({ provides: 'config', needs: [], export: true }) class Config { - provide() { + run() { return { config: { runtime: 'deno' } }; } } @@ -24,7 +24,7 @@ class Auth { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } -@Module({ mountpoint: '/api', providers: [Config], steps: [Auth] }) +@Module({ mountpoint: '/api', steps: [Config, Auth] }) class TeapotModule {} @Route('/local') diff --git a/test/deno/mesh.test.ts b/test/deno/mesh.test.ts index cb8fc28..172f3c8 100644 --- a/test/deno/mesh.test.ts +++ b/test/deno/mesh.test.ts @@ -13,14 +13,14 @@ // including Node-only modules this test never executes. tsc covers those. import 'npm:reflect-metadata'; import { assertEquals, assertStringIncludes } from 'jsr:@std/assert'; -import { createApp, Provider, Step, Route, Get, Module, needs } from '../../src/index.ts'; +import { createApp, Step, Route, Get, Module, needs } from '../../src/index.ts'; import { serveDeno } from '../../src/deno.ts'; const SECRET = 's3cr3t'; -@Provider({ provides: 'config', export: true }) +@Step({ provides: 'config', needs: [], export: true }) class Config { - provide() { + run() { return { config: { region: 'mx', runtime: 'deno' } }; } } @@ -30,7 +30,7 @@ class Auth { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } -@Module({ mountpoint: '/api', providers: [Config], steps: [Auth] }) +@Module({ mountpoint: '/api', steps: [Config, Auth] }) class TeapotModule {} @Route('/local')