import assert from 'node:assert/strict' import test from 'node:test' import { existsSync, readFileSync } from 'node:fs' import { resolve } from 'node:path' test('admin build uses the standalone /admin-vue base path from single source', () => { const config = readFileSync(resolve('vite.config.ts'), 'utf8') const appConfig = readFileSync(resolve('src/config/app.ts'), 'utf8') assert.match(appConfig, /export const APP_BASE_PATH = '\/admin-vue\/'/) assert.match(config, /base:\s*APP_BASE_PATH/) assert.match(config, /outDir:\s*['"]dist['"]/) }) test('admin entry and first batch pages exist', () => { for (const file of [ 'index.html', 'src/main.ts', 'src/layout/AdminLayout.vue', 'src/pages/account/UsersPage.vue', 'src/pages/account/MenusPage.vue', 'src/pages/account/GroupsPage.vue', ]) { assert.equal(existsSync(resolve(file)), true, `${file} should exist`) } }) test('admin frontend does not depend on the client new_web_source', () => { const packageJson = readFileSync(resolve('package.json'), 'utf8') assert.doesNotMatch(packageJson, /new_web_source/) })