Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
test(build): skip dist-dependent suites on a tree that was never frontend-built
ni3a7279c47aca0d
diff --git a/tests/build-asset-paths.test.js b/tests/build-asset-paths.test.jsindex 5f5c53dd4..4dff43aa5 100644--- a/tests/build-asset-paths.test.js+++ b/tests/build-asset-paths.test.js@@ -3,17 +3,22 @@ import { readFileSync, existsSync } from 'node:fs';import { fileURLToPath } from 'node:url';import { dirname, resolve } from 'node:path';+import { BUILD_HINT, DIST_DIR as dist, HAS_FRONTEND_BUILD } from './helpers/dist-built.js';+const __dirname = dirname(fileURLToPath(import.meta.url));const repoRoot = resolve(__dirname, '..');-const dist = resolve(repoRoot, 'dist');-const HAS_DIST = existsSync(dist);+// The deploy chain writes sub-artifacts into dist/ before the frontend build+// runs, so the directory existing proved nothing: on a tree built only that far+// this suite failed on every page it looked for. HAS_FRONTEND_BUILD asks the+// question that matters.+if (!HAS_FRONTEND_BUILD) console.warn(`[build-asset-paths] skipping: ${BUILD_HINT}`);// Guards against the regression where /style.css 404'd in production// because public/* HTML rollup inputs collide with the public-dir copy.// If you see this fail, the deployed site is likely about to break the// same way studio did on 2026-04-27.-describe.skipIf(!HAS_DIST)('build asset paths', () => {+describe.skipIf(!HAS_FRONTEND_BUILD)('build asset paths', () => {it('serves /style.css from dist root', () => {expect(existsSync(resolve(dist, 'style.css'))).toBe(true);diff --git a/tests/helpers/dist-built.js b/tests/helpers/dist-built.jsnew file mode 100644index 000000000..0ced6cd3c--- /dev/null+++ b/tests/helpers/dist-built.js@@ -0,0 +1,32 @@+// Was the frontend actually built into dist/?+//+// `existsSync('dist')` is not that question. The deploy chain writes several+// sub-artifacts into dist/ (agent-3d, avatar-sdk, avatar-studio, docs) BEFORE+// the frontend `vite build` runs, and `npm run build:vercel` writes those and+// stops. Either leaves a dist/ directory holding no pages at all, which a+// bare directory check reads as "built" and every dist-dependent assertion+// then fails against: a missing stylesheet, an empty 404 body, a server that+// serves nothing. That reads like a product regression and is not one.+//+// dist/index.html is the marker, because it is written by the frontend+// `vite build` step itself. Present means the pages are there and the+// assertions are meaningful; absent means the tree was never frontend-built+// and the suite should skip rather than invent a failure. A tree that IS built+// and is missing a page still fails, which is the regression these suites+// exist to catch.++import { existsSync } from 'node:fs';+import { fileURLToPath } from 'node:url';+import path from 'node:path';++const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..');++/** The dist/ directory, built or not. */+export const DIST_DIR = path.join(REPO_ROOT, 'dist');++/** True when the frontend build has written its pages into dist/. */+export const HAS_FRONTEND_BUILD = existsSync(path.join(DIST_DIR, 'index.html'));++/** One line naming the command that makes a skipped suite run. */+export const BUILD_HINT =+ 'dist/ has no frontend build (no dist/index.html). Run `npm run build:gcp` to build it.';diff --git a/tests/server-404-routes.test.js b/tests/server-404-routes.test.jsindex af03125db..d19deee43 100644--- a/tests/server-404-routes.test.js+++ b/tests/server-404-routes.test.js@@ -2,6 +2,7 @@ import { describe, it, expect, beforeAll, afterAll } from 'vitest';import path from 'node:path';import { fileURLToPath } from 'node:url';import { startTestServer } from './helpers/test-server.js';+import { BUILD_HINT, HAS_FRONTEND_BUILD } from './helpers/dist-built.js';import { isMissingShellPage } from '../server/shell-pages.mjs';// An unknown URL must end in the designed 404 page with a real 404 status.@@ -16,10 +17,16 @@ import { isMissingShellPage } from '../server/shell-pages.mjs';// Both are decided by server/shell-pages.mjs, which resolves the markdown// article a shell would fetch before the shell is served.+// The server serves its pages out of dist/, so on a tree that was never+// frontend-built every route answers with nothing and each assertion below+// fails describing a 404 page that was simply never generated.+if (!HAS_FRONTEND_BUILD) console.warn(`[server-404-routes] skipping: ${BUILD_HINT}`);+let BASE;let server;beforeAll(async () => {+ if (!HAS_FRONTEND_BUILD) return;server = await startTestServer();BASE = server.base;}, 30000);@@ -30,7 +37,7 @@ afterAll(() => {const get = (path) => fetch(`${BASE}${path}`, { redirect: 'manual' });-describe('unknown routes land on the designed 404', () => {+describe.skipIf(!HAS_FRONTEND_BUILD)('unknown routes land on the designed 404', () => {it('an unknown page returns 404 with the designed page, not a bare body', async () => {const res = await get('/definitely-not-a-real-page-xyz');expect(res.status).toBe(404);@@ -59,7 +66,7 @@ describe('unknown routes land on the designed 404', () => {});});-describe('shared-shell surfaces do not soft-404', () => {+describe.skipIf(!HAS_FRONTEND_BUILD)('shared-shell surfaces do not soft-404', () => {it('an unknown /docs/ slug returns 404, not the docs shell at 200', async () => {const res = await get('/docs/definitely-not-a-real-doc-xyz');expect(res.status).toBe(404);