mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
docs: document root test files
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// Appcast tests validate generated update appcast metadata.
|
||||
import { readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { canonicalSparkleBuildFromVersion } from "../scripts/sparkle-build.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Architecture smell tests flag unwanted dependency and layout patterns.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { collectArchitectureSmells, main } from "../scripts/check-architecture-smells.mjs";
|
||||
import { createCapturedIo } from "./helpers/captured-io.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// CLI JSON stdout E2E tests validate machine-readable CLI output.
|
||||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Extension import boundary tests enforce extension/core import rules.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { main as extensionPluginSdkMain } from "../scripts/check-extension-plugin-sdk-boundary.mjs";
|
||||
import { main as sdkPackageMain } from "../scripts/check-sdk-package-extension-import-boundary.mjs";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Extension package TypeScript boundary tests cover package compile isolation.
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Extension test boundary tests enforce extension test layout rules.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { BUNDLED_PLUGIN_PATH_PREFIX } from "openclaw/plugin-sdk/test-fixtures";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Gateway multi E2E tests validate multi-gateway runtime behavior.
|
||||
import { afterAll, describe, expect, it } from "vitest";
|
||||
import { GatewayClient } from "../src/gateway/client.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Git hook tests validate pre-commit hook behavior and scripts.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { mkdirSync, symlinkSync, writeFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Global test setup installs shared environment before Vitest projects run.
|
||||
import { installTestEnv } from "./test-env";
|
||||
|
||||
export default async () => {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Live image generation CLI tests validate inferred CLI image generation.
|
||||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Live image generation runtime tests cover image provider runtime behavior.
|
||||
import {
|
||||
registerProviderPlugin,
|
||||
requireRegisteredProvider,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Non-isolated runner helps execute tests without Vitest isolation.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { TestRunner, type RunnerTask, type RunnerTestSuite, vi } from "vitest";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// npm publish plan tests validate package publish planning rules.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
resolveNpmDistTagMirrorAuth,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Official channel catalog tests validate catalog metadata and entries.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { bundledPluginRoot } from "openclaw/plugin-sdk/test-fixtures";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// OpenClaw launcher E2E tests validate launcher process behavior.
|
||||
import { spawn, spawnSync } from "node:child_process";
|
||||
import { once } from "node:events";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// OpenClaw npm postpublish tests validate postpublish verification behavior.
|
||||
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { dirname, join } from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// OpenClaw npm release check tests validate package release checks.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// OpenClaw prepack tests validate package prepack output.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
collectPreparedPrepackErrors,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package manager config tests validate workspace package manager settings.
|
||||
import fs from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { parse } from "yaml";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Package script tests validate root package script invariants.
|
||||
import fs from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin ClawHub release tests validate plugin release metadata and artifacts.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import { chmodSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
||||
import { delimiter, join } from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin extension import boundary tests enforce plugin extension import rules.
|
||||
import { readFileSync } from "node:fs";
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin npm manifest tests validate generated plugin package manifests.
|
||||
import { spawnSync } from "node:child_process";
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { dirname, join, win32 } from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin npm release tests validate plugin npm release artifacts.
|
||||
import { mkdirSync, readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { bundledPluginFile, bundledPluginRoot } from "openclaw/plugin-sdk/test-fixtures";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Plugin npm runtime build tests validate plugin runtime package builds.
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// QA Convex credential tests validate credential payload shapes.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
CredentialPayloadValidationError,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Release check tests cover release validation script behavior.
|
||||
import { chmodSync, mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import { dirname, join, win32 } from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Home isolation tests validate HOME and state directory isolation.
|
||||
import path from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createConfigIO } from "../src/config/config.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// OpenClaw runtime test setup installs runtime mocks and cleanup.
|
||||
import { afterAll, afterEach, beforeAll, vi } from "vitest";
|
||||
import type {
|
||||
ChannelId,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Extension test setup installs extension-specific mocks and cleanup.
|
||||
import { afterAll, beforeEach, vi } from "vitest";
|
||||
import { installSharedTestSetup } from "./setup.shared.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Shared test setup installs common Vitest mocks and cleanup behavior.
|
||||
import { vi } from "vitest";
|
||||
|
||||
const openAiCodexTokenRefreshTestHook = "__OPENCLAW_TEST_REFRESH_OPENAI_CODEX_TOKEN__";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Default test setup installs the shared test environment.
|
||||
import { installSharedTestSetup } from "./setup.shared.js";
|
||||
|
||||
installSharedTestSetup();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Test environment tests validate shared env setup helpers.
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { importFreshModule } from "openclaw/plugin-sdk/test-fixtures";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Test environment helpers install process env defaults for tests.
|
||||
import { execFileSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import { createRequire } from "node:module";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Test helper extension boundary tests enforce helper import boundaries.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
collectTestHelperExtensionImportBoundaryInventory,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// UI presenter next-run tests cover presenter scheduling output.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { t } from "../ui/src/i18n/index.ts";
|
||||
import { formatNextRun } from "../ui/src/ui/presenter.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest boundary config tests validate boundary test configuration.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { normalizeConfigPath, normalizeConfigPaths } from "./helpers/vitest-config-paths.js";
|
||||
import {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest extensions config tests validate bundled extension test configuration.
|
||||
import { bundledPluginFile } from "openclaw/plugin-sdk/test-fixtures";
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createPatternFileHelper } from "./helpers/pattern-file.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest light path tests validate light test include path generation.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
isCommandsLightTarget,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest performance config tests validate performance test project setup.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { loadVitestExperimentalConfig } from "./vitest/vitest.performance-config.ts";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest project config tests validate aggregate Vitest project wiring.
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createPatternFileHelper } from "./helpers/pattern-file.js";
|
||||
import { normalizeConfigPath, normalizeConfigPaths } from "./helpers/vitest-config-paths.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest scoped config tests validate scoped project config generation.
|
||||
import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest UI package config tests validate UI package test project settings.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import uiConfig from "../ui/vitest.config.ts";
|
||||
import uiNodeConfig from "../ui/vitest.node.config.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest unit config tests validate unit test project configuration.
|
||||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import { createPatternFileHelper } from "./helpers/pattern-file.js";
|
||||
import { normalizeConfigPath, normalizeConfigPaths } from "./helpers/vitest-config-paths.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest unit-fast config tests validate fast unit test project setup.
|
||||
import { beforeAll, describe, expect, it } from "vitest";
|
||||
import { spawnNodeEvalSync } from "../src/test-utils/node-process.js";
|
||||
import { createCommandsLightVitestConfig } from "./vitest/vitest.commands-light.config.ts";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Vitest unit path tests validate unit test include and exclude paths.
|
||||
import { bundledPluginFile } from "openclaw/plugin-sdk/test-fixtures";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { isUnitConfigTestFile } from "./vitest/vitest.unit-paths.mjs";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// Web provider boundary tests enforce provider import boundaries.
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
collectWebFetchProviderBoundaryViolations,
|
||||
|
||||
Reference in New Issue
Block a user