From f5903d1cd8ec0ea0d7ffa95f4da77838518e5803 Mon Sep 17 00:00:00 2001 From: jdalton Date: Wed, 18 Nov 2026 14:54:45 -0500 Subject: [PATCH] test: add Termless terminal snapshots --- .config/snapshot-path.mts | 15 + .config/tsconfig.scripts.json | 1 + .config/vitest.config.mts | 10 +- .config/vitest.e2e.config.mts | 3 + .config/vitest.integration.config.mts | 3 + .config/vitest.native.config.mts | 3 + .config/vitest.terminal.config.mts | 15 +- .gitattributes | 4 - .gitignore | 284 +----------------- eslint.config.js | 10 +- package.json | 9 +- pnpm-lock.yaml | 20 ++ scripts/{test => refresh}/snapshots.mts | 17 +- .../snapshots/dependencies.mts} | 30 +- scripts/test/native.mts | 2 +- src/sea/README.md | 2 +- test/e2e/termless.test.mts | 42 +++ test/lib/native/cli-harness.mts | 4 +- test/lib/{terminal => termless}/animation.mts | 13 +- .../{optimize-svg.mts => termless/svgo.mts} | 0 .../commands/cli-behavior.native.test.mts | 18 +- test/native/commands/cli.native.test.mts | 4 +- test/native/commands/tui.native.test.mts | 10 +- test/snapshots/.gitattributes | 2 + .../cli-behavior.native.config-get.svg} | 0 ...li-behavior.native.config-invalid-key.svg} | 0 .../cli-behavior.native.config-list.svg} | 0 .../cli-behavior.native.json-missing.svg} | 0 .../cli-behavior.native.json-seeded.svg} | 0 ...havior.native.manifest-setup.canceled.svg} | 0 ...r.native.manifest-setup.exit-selected.svg} | 0 ...i-behavior.native.manifest-setup.menu.svg} | 0 ...li-behavior.native.wrapper-on-dry-run.svg} | 0 ...native.socket-cdxgen-unsupported-type.svg} | 0 .../cli.native.socket-help-analytics.svg} | 0 .../cli.native.socket-help-audit-log.svg} | 0 .../cli.native.socket-help-cdxgen.svg} | 0 .../termless/cli.native.socket-help-ci.svg} | 0 .../cli.native.socket-help-config-auto.svg} | 0 .../cli.native.socket-help-config-get.svg} | 0 .../cli.native.socket-help-config-list.svg} | 0 .../cli.native.socket-help-config-set.svg} | 0 .../cli.native.socket-help-config-unset.svg} | 0 .../cli.native.socket-help-config.svg} | 0 .../cli.native.socket-help-dependencies.svg} | 0 .../termless/cli.native.socket-help-fix.svg} | 0 ...native.socket-help-install-completion.svg} | 0 .../cli.native.socket-help-install.svg} | 0 .../termless/cli.native.socket-help-json.svg} | 0 .../cli.native.socket-help-license.svg} | 0 .../cli.native.socket-help-login.svg} | 0 .../cli.native.socket-help-logout.svg} | 0 .../cli.native.socket-help-manifest-auto.svg} | 0 ...cli.native.socket-help-manifest-bazel.svg} | 0 ...li.native.socket-help-manifest-cdxgen.svg} | 0 ...cli.native.socket-help-manifest-conda.svg} | 0 ...li.native.socket-help-manifest-dotnet.svg} | 0 ...-help-manifest-dynamic-sbom-inference.svg} | 0 ...li.native.socket-help-manifest-gradle.svg} | 0 ...li.native.socket-help-manifest-kotlin.svg} | 0 ...cli.native.socket-help-manifest-maven.svg} | 0 ...cli.native.socket-help-manifest-scala.svg} | 0 ...cli.native.socket-help-manifest-setup.svg} | 0 .../cli.native.socket-help-manifest.svg} | 0 .../termless/cli.native.socket-help-npm.svg} | 0 .../termless/cli.native.socket-help-npx.svg} | 0 .../termless/cli.native.socket-help-oops.svg} | 0 .../cli.native.socket-help-optimize.svg} | 0 ...socket-help-organization-dependencies.svg} | 0 ....native.socket-help-organization-list.svg} | 0 ...cket-help-organization-policy-license.svg} | 0 ...ket-help-organization-policy-security.svg} | 0 ...ative.socket-help-organization-policy.svg} | 0 ...native.socket-help-organization-quota.svg} | 0 .../cli.native.socket-help-organization.svg} | 0 .../cli.native.socket-help-package-score.svg} | 0 ...li.native.socket-help-package-shallow.svg} | 0 .../cli.native.socket-help-package.svg} | 0 .../cli.native.socket-help-patch.svg} | 0 .../termless/cli.native.socket-help-pnpm.svg} | 0 .../cli.native.socket-help-raw-npm.svg} | 0 .../cli.native.socket-help-raw-npx.svg} | 0 ....native.socket-help-repository-create.svg} | 0 ...cli.native.socket-help-repository-del.svg} | 0 ...li.native.socket-help-repository-list.svg} | 0 ....native.socket-help-repository-update.svg} | 0 ...li.native.socket-help-repository-view.svg} | 0 .../cli.native.socket-help-repository.svg} | 0 .../cli.native.socket-help-scan-create.svg} | 0 .../cli.native.socket-help-scan-del.svg} | 0 .../cli.native.socket-help-scan-diff.svg} | 0 .../cli.native.socket-help-scan-github.svg} | 0 .../cli.native.socket-help-scan-list.svg} | 0 .../cli.native.socket-help-scan-metadata.svg} | 0 .../cli.native.socket-help-scan-reach.svg} | 0 .../cli.native.socket-help-scan-report.svg} | 0 .../cli.native.socket-help-scan-setup.svg} | 0 .../cli.native.socket-help-scan-view.svg} | 0 .../termless/cli.native.socket-help-scan.svg} | 0 .../cli.native.socket-help-security.svg} | 0 .../cli.native.socket-help-threat-feed.svg} | 0 ...tive.socket-help-uninstall-completion.svg} | 0 .../cli.native.socket-help-uninstall.svg} | 0 .../cli.native.socket-help-wrapper.svg} | 0 .../termless/cli.native.socket-help-yarn.svg} | 0 .../termless/cli.native.socket-help.svg} | 0 .../cli.native.socket-manifest-dry-run.svg} | 0 .../cli.native.socket-patch-apply-help.svg} | 0 .../cli.native.socket-patch-get-help.svg} | 0 .../cli.native.socket-patch-list-help.svg} | 0 .../cli.native.socket-patch-remove-help.svg} | 0 .../cli.native.socket-patch-repair-help.svg} | 0 ...cli.native.socket-patch-rollback-help.svg} | 0 .../cli.native.socket-patch-scan-help.svg} | 0 .../cli.native.socket-patch-setup-help.svg} | 0 .../cli.native.socket-patch-version.svg} | 0 ...cli.native.socket-scan-setup.canceled.svg} | 0 ...ive.socket-scan-setup.github-selected.svg} | 0 .../cli.native.socket-scan-setup.menu.svg} | 0 .../termless/cli.native.socket-version.svg} | 0 .../termless/self-update.notice-standard.svg} | 0 .../termless/self-update.notice-wide.svg} | 0 .../termless/self-update.notice-wrapped.svg} | 0 .../termless/self-update.suppressed.svg} | 0 .../termless.node-e-fixture.after-enter.svg | 9 + .../termless.node-e-fixture.prompt.svg | 9 + .../termless/tui.native.analytics.svg} | 0 .../termless/tui.native.audit-log.svg} | 0 .../termless/tui.native.threat-feed.svg} | 0 .../utils/self-update.test.mts} | 8 +- .../{terminal => termless}/animation.test.mts | 6 +- .../svgo.test.mts} | 2 +- .../{test => refresh}/snapshots.test.mts | 9 +- .../snapshots/dependencies.test.mts} | 8 +- 134 files changed, 214 insertions(+), 358 deletions(-) create mode 100644 .config/snapshot-path.mts rename scripts/{test => refresh}/snapshots.mts (93%) rename scripts/{test/snapshot-dependencies.mts => refresh/snapshots/dependencies.mts} (77%) create mode 100644 test/e2e/termless.test.mts rename test/lib/{terminal => termless}/animation.mts (96%) rename test/lib/{optimize-svg.mts => termless/svgo.mts} (100%) create mode 100644 test/snapshots/.gitattributes rename test/{native-snapshots/behavior-config-get.output.svg => snapshots/termless/cli-behavior.native.config-get.svg} (100%) rename test/{native-snapshots/behavior-config-invalid-key.output.svg => snapshots/termless/cli-behavior.native.config-invalid-key.svg} (100%) rename test/{native-snapshots/behavior-config-list.output.svg => snapshots/termless/cli-behavior.native.config-list.svg} (100%) rename test/{native-snapshots/behavior-json-missing.output.svg => snapshots/termless/cli-behavior.native.json-missing.svg} (100%) rename test/{native-snapshots/behavior-json-seeded.output.svg => snapshots/termless/cli-behavior.native.json-seeded.svg} (100%) rename test/{native-snapshots/behavior-manifest-setup.canceled.svg => snapshots/termless/cli-behavior.native.manifest-setup.canceled.svg} (100%) rename test/{native-snapshots/behavior-manifest-setup.exit-selected.svg => snapshots/termless/cli-behavior.native.manifest-setup.exit-selected.svg} (100%) rename test/{native-snapshots/behavior-manifest-setup.menu.svg => snapshots/termless/cli-behavior.native.manifest-setup.menu.svg} (100%) rename test/{native-snapshots/behavior-wrapper-on-dry-run.output.svg => snapshots/termless/cli-behavior.native.wrapper-on-dry-run.svg} (100%) rename test/{native-snapshots/socket-cdxgen-unsupported-type.unsupported-type.svg => snapshots/termless/cli.native.socket-cdxgen-unsupported-type.svg} (100%) rename test/{native-snapshots/socket-help-analytics.help.svg => snapshots/termless/cli.native.socket-help-analytics.svg} (100%) rename test/{native-snapshots/socket-help-audit-log.help.svg => snapshots/termless/cli.native.socket-help-audit-log.svg} (100%) rename test/{native-snapshots/socket-help-cdxgen.help.svg => snapshots/termless/cli.native.socket-help-cdxgen.svg} (100%) rename test/{native-snapshots/socket-help-ci.help.svg => snapshots/termless/cli.native.socket-help-ci.svg} (100%) rename test/{native-snapshots/socket-help-config-auto.help.svg => snapshots/termless/cli.native.socket-help-config-auto.svg} (100%) rename test/{native-snapshots/socket-help-config-get.help.svg => snapshots/termless/cli.native.socket-help-config-get.svg} (100%) rename test/{native-snapshots/socket-help-config-list.help.svg => snapshots/termless/cli.native.socket-help-config-list.svg} (100%) rename test/{native-snapshots/socket-help-config-set.help.svg => snapshots/termless/cli.native.socket-help-config-set.svg} (100%) rename test/{native-snapshots/socket-help-config-unset.help.svg => snapshots/termless/cli.native.socket-help-config-unset.svg} (100%) rename test/{native-snapshots/socket-help-config.help.svg => snapshots/termless/cli.native.socket-help-config.svg} (100%) rename test/{native-snapshots/socket-help-dependencies.help.svg => snapshots/termless/cli.native.socket-help-dependencies.svg} (100%) rename test/{native-snapshots/socket-help-fix.help.svg => snapshots/termless/cli.native.socket-help-fix.svg} (100%) rename test/{native-snapshots/socket-help-install-completion.help.svg => snapshots/termless/cli.native.socket-help-install-completion.svg} (100%) rename test/{native-snapshots/socket-help-install.help.svg => snapshots/termless/cli.native.socket-help-install.svg} (100%) rename test/{native-snapshots/socket-help-json.help.svg => snapshots/termless/cli.native.socket-help-json.svg} (100%) rename test/{native-snapshots/socket-help-license.help.svg => snapshots/termless/cli.native.socket-help-license.svg} (100%) rename test/{native-snapshots/socket-help-login.help.svg => snapshots/termless/cli.native.socket-help-login.svg} (100%) rename test/{native-snapshots/socket-help-logout.help.svg => snapshots/termless/cli.native.socket-help-logout.svg} (100%) rename test/{native-snapshots/socket-help-manifest-auto.help.svg => snapshots/termless/cli.native.socket-help-manifest-auto.svg} (100%) rename test/{native-snapshots/socket-help-manifest-bazel.help.svg => snapshots/termless/cli.native.socket-help-manifest-bazel.svg} (100%) rename test/{native-snapshots/socket-help-manifest-cdxgen.help.svg => snapshots/termless/cli.native.socket-help-manifest-cdxgen.svg} (100%) rename test/{native-snapshots/socket-help-manifest-conda.help.svg => snapshots/termless/cli.native.socket-help-manifest-conda.svg} (100%) rename test/{native-snapshots/socket-help-manifest-dotnet.help.svg => snapshots/termless/cli.native.socket-help-manifest-dotnet.svg} (100%) rename test/{native-snapshots/socket-help-manifest-dynamic-sbom-inference.help.svg => snapshots/termless/cli.native.socket-help-manifest-dynamic-sbom-inference.svg} (100%) rename test/{native-snapshots/socket-help-manifest-gradle.help.svg => snapshots/termless/cli.native.socket-help-manifest-gradle.svg} (100%) rename test/{native-snapshots/socket-help-manifest-kotlin.help.svg => snapshots/termless/cli.native.socket-help-manifest-kotlin.svg} (100%) rename test/{native-snapshots/socket-help-manifest-maven.help.svg => snapshots/termless/cli.native.socket-help-manifest-maven.svg} (100%) rename test/{native-snapshots/socket-help-manifest-scala.help.svg => snapshots/termless/cli.native.socket-help-manifest-scala.svg} (100%) rename test/{native-snapshots/socket-help-manifest-setup.help.svg => snapshots/termless/cli.native.socket-help-manifest-setup.svg} (100%) rename test/{native-snapshots/socket-help-manifest.help.svg => snapshots/termless/cli.native.socket-help-manifest.svg} (100%) rename test/{native-snapshots/socket-help-npm.help.svg => snapshots/termless/cli.native.socket-help-npm.svg} (100%) rename test/{native-snapshots/socket-help-npx.help.svg => snapshots/termless/cli.native.socket-help-npx.svg} (100%) rename test/{native-snapshots/socket-help-oops.help.svg => snapshots/termless/cli.native.socket-help-oops.svg} (100%) rename test/{native-snapshots/socket-help-optimize.help.svg => snapshots/termless/cli.native.socket-help-optimize.svg} (100%) rename test/{native-snapshots/socket-help-organization-dependencies.help.svg => snapshots/termless/cli.native.socket-help-organization-dependencies.svg} (100%) rename test/{native-snapshots/socket-help-organization-list.help.svg => snapshots/termless/cli.native.socket-help-organization-list.svg} (100%) rename test/{native-snapshots/socket-help-organization-policy-license.help.svg => snapshots/termless/cli.native.socket-help-organization-policy-license.svg} (100%) rename test/{native-snapshots/socket-help-organization-policy-security.help.svg => snapshots/termless/cli.native.socket-help-organization-policy-security.svg} (100%) rename test/{native-snapshots/socket-help-organization-policy.help.svg => snapshots/termless/cli.native.socket-help-organization-policy.svg} (100%) rename test/{native-snapshots/socket-help-organization-quota.help.svg => snapshots/termless/cli.native.socket-help-organization-quota.svg} (100%) rename test/{native-snapshots/socket-help-organization.help.svg => snapshots/termless/cli.native.socket-help-organization.svg} (100%) rename test/{native-snapshots/socket-help-package-score.help.svg => snapshots/termless/cli.native.socket-help-package-score.svg} (100%) rename test/{native-snapshots/socket-help-package-shallow.help.svg => snapshots/termless/cli.native.socket-help-package-shallow.svg} (100%) rename test/{native-snapshots/socket-help-package.help.svg => snapshots/termless/cli.native.socket-help-package.svg} (100%) rename test/{native-snapshots/socket-help-patch.help.svg => snapshots/termless/cli.native.socket-help-patch.svg} (100%) rename test/{native-snapshots/socket-help-pnpm.help.svg => snapshots/termless/cli.native.socket-help-pnpm.svg} (100%) rename test/{native-snapshots/socket-help-raw-npm.help.svg => snapshots/termless/cli.native.socket-help-raw-npm.svg} (100%) rename test/{native-snapshots/socket-help-raw-npx.help.svg => snapshots/termless/cli.native.socket-help-raw-npx.svg} (100%) rename test/{native-snapshots/socket-help-repository-create.help.svg => snapshots/termless/cli.native.socket-help-repository-create.svg} (100%) rename test/{native-snapshots/socket-help-repository-del.help.svg => snapshots/termless/cli.native.socket-help-repository-del.svg} (100%) rename test/{native-snapshots/socket-help-repository-list.help.svg => snapshots/termless/cli.native.socket-help-repository-list.svg} (100%) rename test/{native-snapshots/socket-help-repository-update.help.svg => snapshots/termless/cli.native.socket-help-repository-update.svg} (100%) rename test/{native-snapshots/socket-help-repository-view.help.svg => snapshots/termless/cli.native.socket-help-repository-view.svg} (100%) rename test/{native-snapshots/socket-help-repository.help.svg => snapshots/termless/cli.native.socket-help-repository.svg} (100%) rename test/{native-snapshots/socket-help-scan-create.help.svg => snapshots/termless/cli.native.socket-help-scan-create.svg} (100%) rename test/{native-snapshots/socket-help-scan-del.help.svg => snapshots/termless/cli.native.socket-help-scan-del.svg} (100%) rename test/{native-snapshots/socket-help-scan-diff.help.svg => snapshots/termless/cli.native.socket-help-scan-diff.svg} (100%) rename test/{native-snapshots/socket-help-scan-github.help.svg => snapshots/termless/cli.native.socket-help-scan-github.svg} (100%) rename test/{native-snapshots/socket-help-scan-list.help.svg => snapshots/termless/cli.native.socket-help-scan-list.svg} (100%) rename test/{native-snapshots/socket-help-scan-metadata.help.svg => snapshots/termless/cli.native.socket-help-scan-metadata.svg} (100%) rename test/{native-snapshots/socket-help-scan-reach.help.svg => snapshots/termless/cli.native.socket-help-scan-reach.svg} (100%) rename test/{native-snapshots/socket-help-scan-report.help.svg => snapshots/termless/cli.native.socket-help-scan-report.svg} (100%) rename test/{native-snapshots/socket-help-scan-setup.help.svg => snapshots/termless/cli.native.socket-help-scan-setup.svg} (100%) rename test/{native-snapshots/socket-help-scan-view.help.svg => snapshots/termless/cli.native.socket-help-scan-view.svg} (100%) rename test/{native-snapshots/socket-help-scan.help.svg => snapshots/termless/cli.native.socket-help-scan.svg} (100%) rename test/{native-snapshots/socket-help-security.help.svg => snapshots/termless/cli.native.socket-help-security.svg} (100%) rename test/{native-snapshots/socket-help-threat-feed.help.svg => snapshots/termless/cli.native.socket-help-threat-feed.svg} (100%) rename test/{native-snapshots/socket-help-uninstall-completion.help.svg => snapshots/termless/cli.native.socket-help-uninstall-completion.svg} (100%) rename test/{native-snapshots/socket-help-uninstall.help.svg => snapshots/termless/cli.native.socket-help-uninstall.svg} (100%) rename test/{native-snapshots/socket-help-wrapper.help.svg => snapshots/termless/cli.native.socket-help-wrapper.svg} (100%) rename test/{native-snapshots/socket-help-yarn.help.svg => snapshots/termless/cli.native.socket-help-yarn.svg} (100%) rename test/{native-snapshots/socket-help.help.svg => snapshots/termless/cli.native.socket-help.svg} (100%) rename test/{native-snapshots/socket-manifest-dry-run.dry-run.svg => snapshots/termless/cli.native.socket-manifest-dry-run.svg} (100%) rename test/{native-snapshots/socket-patch-apply-help.help.svg => snapshots/termless/cli.native.socket-patch-apply-help.svg} (100%) rename test/{native-snapshots/socket-patch-get-help.help.svg => snapshots/termless/cli.native.socket-patch-get-help.svg} (100%) rename test/{native-snapshots/socket-patch-list-help.help.svg => snapshots/termless/cli.native.socket-patch-list-help.svg} (100%) rename test/{native-snapshots/socket-patch-remove-help.help.svg => snapshots/termless/cli.native.socket-patch-remove-help.svg} (100%) rename test/{native-snapshots/socket-patch-repair-help.help.svg => snapshots/termless/cli.native.socket-patch-repair-help.svg} (100%) rename test/{native-snapshots/socket-patch-rollback-help.help.svg => snapshots/termless/cli.native.socket-patch-rollback-help.svg} (100%) rename test/{native-snapshots/socket-patch-scan-help.help.svg => snapshots/termless/cli.native.socket-patch-scan-help.svg} (100%) rename test/{native-snapshots/socket-patch-setup-help.help.svg => snapshots/termless/cli.native.socket-patch-setup-help.svg} (100%) rename test/{native-snapshots/socket-patch-version.version.svg => snapshots/termless/cli.native.socket-patch-version.svg} (100%) rename test/{native-snapshots/socket-scan-setup.canceled.svg => snapshots/termless/cli.native.socket-scan-setup.canceled.svg} (100%) rename test/{native-snapshots/socket-scan-setup.github-selected.svg => snapshots/termless/cli.native.socket-scan-setup.github-selected.svg} (100%) rename test/{native-snapshots/socket-scan-setup.menu.svg => snapshots/termless/cli.native.socket-scan-setup.menu.svg} (100%) rename test/{native-snapshots/socket-version.version.svg => snapshots/termless/cli.native.socket-version.svg} (100%) rename test/{native-snapshots/self-update-notice-standard.standard.svg => snapshots/termless/self-update.notice-standard.svg} (100%) rename test/{native-snapshots/self-update-notice-wide.wide.svg => snapshots/termless/self-update.notice-wide.svg} (100%) rename test/{native-snapshots/self-update-notice-wrapped.wrapped.svg => snapshots/termless/self-update.notice-wrapped.svg} (100%) rename test/{native-snapshots/self-update-suppressed.suppressed.svg => snapshots/termless/self-update.suppressed.svg} (100%) create mode 100644 test/snapshots/termless/termless.node-e-fixture.after-enter.svg create mode 100644 test/snapshots/termless/termless.node-e-fixture.prompt.svg rename test/{native-snapshots/native-analytics-tui.charts.svg => snapshots/termless/tui.native.analytics.svg} (100%) rename test/{native-snapshots/native-audit-log-tui.table.svg => snapshots/termless/tui.native.audit-log.svg} (100%) rename test/{native-snapshots/native-threat-feed-tui.table.svg => snapshots/termless/tui.native.threat-feed.svg} (100%) rename test/{unit/utils/self-update.terminal.test.mts => termless/utils/self-update.test.mts} (95%) rename test/unit/lib/{terminal => termless}/animation.test.mts (98%) rename test/unit/lib/{optimize-svg.test.mts => termless/svgo.test.mts} (97%) rename test/unit/scripts/{test => refresh}/snapshots.test.mts (96%) rename test/unit/scripts/{test/snapshot-dependencies.test.mts => refresh/snapshots/dependencies.test.mts} (71%) diff --git a/.config/snapshot-path.mts b/.config/snapshot-path.mts new file mode 100644 index 0000000000..3c4f63a00a --- /dev/null +++ b/.config/snapshot-path.mts @@ -0,0 +1,15 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' + +const root = fileURLToPath(new URL('../', import.meta.url)) + +export function resolveSnapshotPath( + testPath: string, + extension: string, +): string { + return path.join( + root, + 'test/snapshots/vite', + path.relative(root, testPath) + extension, + ) +} diff --git a/.config/tsconfig.scripts.json b/.config/tsconfig.scripts.json index 103a00d3ae..486698d283 100644 --- a/.config/tsconfig.scripts.json +++ b/.config/tsconfig.scripts.json @@ -16,6 +16,7 @@ "../scripts/*.mts", "../scripts/lib/**/*.mts", "../scripts/setup/**/*.mts", + "../scripts/refresh/**/*.mts", "../scripts/test/**/*.mts", "../src/sea/version.mts" ], diff --git a/.config/vitest.config.mts b/.config/vitest.config.mts index cbb627ec5f..eefa13d630 100644 --- a/.config/vitest.config.mts +++ b/.config/vitest.config.mts @@ -2,12 +2,15 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' +import { resolveSnapshotPath } from './snapshot-path.mts' + export default defineConfig({ root: fileURLToPath(new URL('../', import.meta.url)), resolve: { preserveSymlinks: false, }, test: { + resolveSnapshotPath, // Keep the package unit lane scoped to this CLI. The checkout also contains // ignored upstream repositories and fleet tooling with independent deps and // Vitest configs; those are exercised by their own workflows. @@ -21,6 +24,7 @@ export default defineConfig({ '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*', // Exclude E2E tests from regular test runs. '**/*.e2e.test.mts', + 'test/e2e/**', // Process-level CLI tests run in the serialized integration lane. '**/*.integration.test.mts', 'src/commands/cli.test.mts', @@ -29,9 +33,9 @@ export default defineConfig({ // Native process tests require the explicitly built SEA artifact. '**/*.native.test.mts', // Termless requires Node 23.6+; these focused UI captures run in the Node 26 lane. - 'test/unit/lib/terminal/animation.test.mts', - 'test/unit/utils/self-update.terminal.test.mts', - 'test/unit/lib/optimize-svg.test.mts', + 'test/unit/lib/termless/animation.test.mts', + 'test/termless/**', + 'test/unit/lib/termless/svgo.test.mts', 'test/unit/lib/native/cli-harness.test.mts', // Exclude test fixtures — directories like test/fixtures/commands/optimize/pnpm{8,9}/ // contain full repo copies populated by `socket optimize` runs; their .test.mts diff --git a/.config/vitest.e2e.config.mts b/.config/vitest.e2e.config.mts index 5c4c891b85..0ed28d4b0d 100644 --- a/.config/vitest.e2e.config.mts +++ b/.config/vitest.e2e.config.mts @@ -2,12 +2,15 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' +import { resolveSnapshotPath } from './snapshot-path.mts' + export default defineConfig({ root: fileURLToPath(new URL('../', import.meta.url)), resolve: { preserveSymlinks: false, }, test: { + resolveSnapshotPath, // Serialize test files to prevent concurrent npx --force invocations // from racing on the npm _npx cache directory. fileParallelism: false, diff --git a/.config/vitest.integration.config.mts b/.config/vitest.integration.config.mts index 3449bdd824..5b37d08616 100644 --- a/.config/vitest.integration.config.mts +++ b/.config/vitest.integration.config.mts @@ -2,12 +2,15 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' +import { resolveSnapshotPath } from './snapshot-path.mts' + export default defineConfig({ root: fileURLToPath(new URL('../', import.meta.url)), resolve: { preserveSymlinks: false, }, test: { + resolveSnapshotPath, // CLI integration tests may exercise npm exec/npx and pnpm dlx. Keep files // serial so they never mutate the same package-manager cache concurrently. fileParallelism: false, diff --git a/.config/vitest.native.config.mts b/.config/vitest.native.config.mts index 00fa819786..994807a1a3 100644 --- a/.config/vitest.native.config.mts +++ b/.config/vitest.native.config.mts @@ -2,12 +2,15 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' +import { resolveSnapshotPath } from './snapshot-path.mts' + export default defineConfig({ root: fileURLToPath(new URL('../', import.meta.url)), resolve: { preserveSymlinks: false, }, test: { + resolveSnapshotPath, // These tests run a native executable and may invoke npm exec/npx or pnpm // dlx. Serialize files to protect both package managers' shared caches. fileParallelism: false, diff --git a/.config/vitest.terminal.config.mts b/.config/vitest.terminal.config.mts index 71d38c3c29..3e04d8a358 100644 --- a/.config/vitest.terminal.config.mts +++ b/.config/vitest.terminal.config.mts @@ -2,16 +2,23 @@ import { fileURLToPath } from 'node:url' import { defineConfig } from 'vitest/config' +import { resolveSnapshotPath } from './snapshot-path.mts' + export default defineConfig({ root: fileURLToPath(new URL('../', import.meta.url)), resolve: { preserveSymlinks: false }, test: { + resolveSnapshotPath, + env: process.argv.some(arg => arg === '--update' || arg === '-u') + ? { SOCKET_CLI_NATIVE_TEST_UPDATE_SNAPSHOTS: 'true' } + : {}, include: [ - 'test/unit/lib/terminal/animation.test.mts', - 'test/unit/utils/self-update.terminal.test.mts', - 'test/unit/lib/terminal/output.test.mts', - 'test/unit/lib/optimize-svg.test.mts', + 'test/e2e/termless.test.mts', + 'test/termless/**/*.test.mts', 'test/unit/lib/native/cli-harness.test.mts', + 'test/unit/lib/terminal/output.test.mts', + 'test/unit/lib/termless/animation.test.mts', + 'test/unit/lib/termless/svgo.test.mts', ], exclude: ['**/node_modules/**', '**/dist/**', '.claude/worktrees/**'], }, diff --git a/.gitattributes b/.gitattributes index 409688ea32..af7d217f6e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1 @@ * text=auto eol=lfs - -# Generated terminal image baselines are reviewed through the screenshot report. -test/native-snapshots/**/*.svg binary linguist-generated=true -test/native-snapshots/**/*.png binary linguist-generated=true diff --git a/.gitignore b/.gitignore index 471255d5a4..f48f0ca5e6 100644 --- a/.gitignore +++ b/.gitignore @@ -38,13 +38,13 @@ !/scripts/babel/ !/scripts/ci/ !/scripts/lib/ +!/scripts/refresh/ +!/scripts/refresh/** !/scripts/release/ !/scripts/rollup/ !/scripts/setup/ !/scripts/test/ !/scripts/test/terminal-report.mts -!/scripts/test/snapshots.mts -!/scripts/test/snapshot-dependencies.mts !/scripts/utils/ !/shadow-bin/ !/src/ @@ -213,141 +213,8 @@ !/src/utils/telemetry/ !/src/vendor/ !/test/ -!/test/native/ -!/test/native/commands/ -!/test/native/commands/cli.native.test.mts -!/test/native/commands/cli-behavior.native.test.mts -!/test/native/commands/tui.native.test.mts -!/test/lib/ -!/test/lib/native/ -!/test/lib/native/tui-api.mts -!/test/unit/utils/packages.test.mts -!/test/unit/ -!/test/unit/github/ -!/test/unit/github/actions/ -!/test/unit/github/actions/repo/ -!/test/unit/github/actions/repo/cache-downloads/ -!/test/unit/github/actions/repo/cache-downloads/index.test.mts -!/test/unit/constants.test.mts -!/test/unit/sea/ -!/test/unit/sea/build/ -!/test/unit/sea/build/lock.test.mts -!/test/unit/sea/build/publish.test.mts -!/test/unit/sea/build-sea.test.mts -!/test/utils/ -!/test/utils/sea.mts -!/test/unit/sea/download-bytes.test.mts -!/test/unit/sea/download-cache.test.mts -!/test/unit/sea/runtime.test.mts -!/test/unit/sea/version.test.mts -!/test/unit/utils/ -!/test/unit/utils/agent.test.mts -!/test/unit/utils/quote-powershell.test.mts -!/test/unit/lib/ -!/test/unit/lib/native/ -!/test/unit/lib/native/cli-harness.test.mts -!/test/unit/lib/native/command-inventory.test.mts -!/test/unit/lib/optimize-svg.test.mts -!/test/unit/lib/terminal/ -!/test/unit/lib/terminal/animation.test.mts -!/test/unit/utils/self-update.terminal.test.mts -!/test/unit/lib/terminal/output.test.mts -!/test/unit/scripts/ -!/test/unit/scripts/test/ -!/test/unit/scripts/constants.test.mts -!/test/native-snapshots/ -!/test/native-snapshots/** -!/test/unit/scripts/test/snapshots.test.mts -!/test/unit/scripts/test/snapshot-dependencies.test.mts -!/test/package-matrix.test.mts -!/test/fixtures/ -!/test/fixtures/commands/ -!/test/fixtures/commands/cdxgen/ -!/test/fixtures/commands/fix/ -!/test/fixtures/commands/fix/e2e-test-js/ -!/test/fixtures/commands/fix/e2e-test-multipm/ -!/test/fixtures/commands/fix/e2e-test-multipm/npm-app/ -!/test/fixtures/commands/fix/e2e-test-multipm/pnpm-app/ -!/test/fixtures/commands/fix/e2e-test-py/ -!/test/fixtures/commands/fix/npm/ -!/test/fixtures/commands/fix/npm/monorepo/ -!/test/fixtures/commands/fix/npm/monorepo/packages/ -!/test/fixtures/commands/fix/npm/monorepo/packages/app/ -!/test/fixtures/commands/fix/npm/monorepo/packages/lib/ -!/test/fixtures/commands/fix/npm/vulnerable-deps/ -!/test/fixtures/commands/fix/pnpm/ -!/test/fixtures/commands/fix/pnpm/monorepo/ -!/test/fixtures/commands/fix/pnpm/monorepo/packages/ -!/test/fixtures/commands/fix/pnpm/monorepo/packages/app/ -!/test/fixtures/commands/fix/pnpm/monorepo/packages/lib/ -!/test/fixtures/commands/fix/pnpm/vulnerable-deps/ -!/test/fixtures/commands/fix/yarn/ -!/test/fixtures/commands/fix/yarn/monorepo/ -!/test/fixtures/commands/fix/yarn/monorepo/packages/ -!/test/fixtures/commands/fix/yarn/monorepo/packages/app/ -!/test/fixtures/commands/fix/yarn/monorepo/packages/lib/ -!/test/fixtures/commands/fix/yarn/vulnerable-deps/ -!/test/fixtures/commands/json/ -!/test/fixtures/commands/manifest/ -!/test/fixtures/commands/manifest/conda/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/dual-marker-dir/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleA/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleA/nested-gradle/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleB/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleB/independent-submodule/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/standalone-gradle/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/bare/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/upper/ -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/vendored/ -!/test/fixtures/commands/manifest/python/ -!/test/fixtures/commands/npm/ -!/test/fixtures/commands/npm/lacking-typosquat/ -!/test/fixtures/commands/npm/npm10/ -!/test/fixtures/commands/npm/npm11/ -!/test/fixtures/commands/npm/npm9/ -!/test/fixtures/commands/optimize/ -!/test/fixtures/commands/optimize/npm/ -!/test/fixtures/commands/optimize/pnpm/ -!/test/fixtures/commands/optimize/pnpm8/ -!/test/fixtures/commands/optimize/pnpm9/ -!/test/fixtures/commands/optimize/yarn/ -!/test/fixtures/commands/patch/ -!/test/fixtures/commands/patch/npm/ -!/test/fixtures/commands/patch/npm/.socket/ -!/test/fixtures/commands/patch/npm/.socket/blobs/ -!/test/fixtures/commands/patch/pnpm/ -!/test/fixtures/commands/patch/pnpm/.socket/ -!/test/fixtures/commands/patch/pnpm/.socket/blobs/ -!/test/fixtures/commands/patch/yarn/ -!/test/fixtures/commands/patch/yarn/.socket/ -!/test/fixtures/commands/patch/yarn/.socket/blobs/ -!/test/fixtures/commands/scan/ -!/test/fixtures/commands/scan/npm-test-workspace-mono/ -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/ -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/package-a/ -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/package-b/ -!/test/fixtures/commands/scan/plain-requirements-txt/ -!/test/fixtures/commands/scan/simple-npm/ -!/test/fixtures/commands/scan/uv-workspace/ -!/test/fixtures/commands/scan/uv-workspace/packages/ -!/test/fixtures/commands/scan/uv-workspace/packages/api/ -!/test/fixtures/commands/scan/uv-workspace/packages/other/ -!/test/fixtures/commands/scan/uv-workspace/packages/shared/ -!/test/fixtures/manifest-bazel/ -!/test/fixtures/manifest-bazel/bzlmod-only/ -!/test/fixtures/manifest-bazel/custom-name-bzlmod/ -!/test/fixtures/manifest-bazel/legacy-only/ -!/test/fixtures/manifest-bazel/legacy-with-load/ -!/test/fixtures/manifest-bazel/migration/ -!/test/fixtures/manifest-bazel/multi-repo-bzlmod/ -!/test/fixtures/manifest-bazel/native/ -!/test/fixtures/manifest-bazel/native/bzlmod/ -!/test/fixtures/manifest-bazel/native/workspace/ -!/test/fixtures/manifest-bazel/python-pypi/ +!/test/** + !/.claude/skills/bump-coana/SKILL.md !/.editorconfig !/.env.dist @@ -1193,7 +1060,6 @@ !/src/utils/sdk.mts !/src/utils/sdk.test.mts !/src/utils/self-update.mts -!/test/unit/utils/self-update.test.mts !/src/utils/semver.mts !/src/utils/serialize-result-json.mts !/src/utils/shadow-links.mts @@ -1225,148 +1091,6 @@ !/src/vendor/coana-cache.mjs !/src/yarn-cli.mts !/taze.config.mts -!/test/blessed-node24-strict.test.mts -!/test/dist-runtime-requires.test.mts -!/test/external-bare-requires.test.mts -!/test/fixtures/commands/cdxgen/package.json -!/test/fixtures/commands/fix/e2e-test-js/package-lock.json -!/test/fixtures/commands/fix/e2e-test-js/package.json -!/test/fixtures/commands/fix/e2e-test-multipm/npm-app/package-lock.json -!/test/fixtures/commands/fix/e2e-test-multipm/npm-app/package.json -!/test/fixtures/commands/fix/e2e-test-multipm/pnpm-app/package.json -!/test/fixtures/commands/fix/e2e-test-multipm/pnpm-app/pnpm-lock.yaml -!/test/fixtures/commands/fix/e2e-test-py/requirements.txt -!/test/fixtures/commands/fix/npm/monorepo/package-lock.json -!/test/fixtures/commands/fix/npm/monorepo/package.json -!/test/fixtures/commands/fix/npm/monorepo/packages/app/package.json -!/test/fixtures/commands/fix/npm/monorepo/packages/lib/package.json -!/test/fixtures/commands/fix/npm/vulnerable-deps/package-lock.json -!/test/fixtures/commands/fix/npm/vulnerable-deps/package.json -!/test/fixtures/commands/fix/pnpm/monorepo/package.json -!/test/fixtures/commands/fix/pnpm/monorepo/packages/app/package.json -!/test/fixtures/commands/fix/pnpm/monorepo/packages/lib/package.json -!/test/fixtures/commands/fix/pnpm/monorepo/pnpm-lock.yaml -!/test/fixtures/commands/fix/pnpm/vulnerable-deps/package.json -!/test/fixtures/commands/fix/pnpm/vulnerable-deps/pnpm-lock.yaml -!/test/fixtures/commands/fix/yarn/monorepo/package.json -!/test/fixtures/commands/fix/yarn/monorepo/packages/app/package.json -!/test/fixtures/commands/fix/yarn/monorepo/packages/lib/package.json -!/test/fixtures/commands/fix/yarn/monorepo/yarn.lock -!/test/fixtures/commands/fix/yarn/vulnerable-deps/package.json -!/test/fixtures/commands/fix/yarn/vulnerable-deps/yarn.lock -!/test/fixtures/commands/json/socket.json -!/test/fixtures/commands/manifest/conda/environment.yml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/dual-marker-dir/build.gradle -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/dual-marker-dir/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleA/nested-gradle/build.gradle -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleA/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleB/independent-submodule/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/moduleB/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/reactor/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/standalone-gradle/build.gradle.kts -!/test/fixtures/commands/manifest/dynamic-sbom-inference/monorepo/standalone-gradle/settings.gradle.kts -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/app-dev.pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/bare/pom -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/other.pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/pom.xml -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/pom.xml.bak -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/upper/POM.XML -!/test/fixtures/commands/manifest/dynamic-sbom-inference/pom-names/vendored/lib-1.0.pom -!/test/fixtures/commands/manifest/python/requirements.txt -!/test/fixtures/commands/npm/lacking-typosquat/package-lock.json -!/test/fixtures/commands/npm/lacking-typosquat/package.json -!/test/fixtures/commands/npm/npm10/package-lock.json -!/test/fixtures/commands/npm/npm10/package.json -!/test/fixtures/commands/npm/npm11/package-lock.json -!/test/fixtures/commands/npm/npm11/package.json -!/test/fixtures/commands/npm/npm9/package-lock.json -!/test/fixtures/commands/npm/npm9/package.json -!/test/fixtures/commands/optimize/npm/package-lock.json -!/test/fixtures/commands/optimize/npm/package.json -!/test/fixtures/commands/optimize/pnpm/package.json -!/test/fixtures/commands/optimize/pnpm/pnpm-lock.yaml -!/test/fixtures/commands/optimize/pnpm8/package.json -!/test/fixtures/commands/optimize/pnpm8/pnpm-lock.yaml -!/test/fixtures/commands/optimize/pnpm9/package.json -!/test/fixtures/commands/optimize/pnpm9/pnpm-lock.yaml -!/test/fixtures/commands/optimize/yarn/package.json -!/test/fixtures/commands/optimize/yarn/yarn.lock -!/test/fixtures/commands/patch/npm/.socket/blobs/76682a9fc3bbe62975176e2541f39a8168877d828d5cad8b56461fc36ac2b856 -!/test/fixtures/commands/patch/npm/.socket/manifest.json -!/test/fixtures/commands/patch/npm/package-lock.json -!/test/fixtures/commands/patch/npm/package.json -!/test/fixtures/commands/patch/pnpm/.socket/blobs/76682a9fc3bbe62975176e2541f39a8168877d828d5cad8b56461fc36ac2b856 -!/test/fixtures/commands/patch/pnpm/.socket/manifest.json -!/test/fixtures/commands/patch/pnpm/package.json -!/test/fixtures/commands/patch/pnpm/pnpm-lock.yaml -!/test/fixtures/commands/patch/yarn/.socket/blobs/76682a9fc3bbe62975176e2541f39a8168877d828d5cad8b56461fc36ac2b856 -!/test/fixtures/commands/patch/yarn/.socket/manifest.json -!/test/fixtures/commands/patch/yarn/package.json -!/test/fixtures/commands/patch/yarn/yarn.lock -!/test/fixtures/commands/scan/npm-test-workspace-mono/.gitignore -!/test/fixtures/commands/scan/npm-test-workspace-mono/package-lock.json -!/test/fixtures/commands/scan/npm-test-workspace-mono/package.json -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/package-a/package.json -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/package-b/index.js -!/test/fixtures/commands/scan/npm-test-workspace-mono/packages/package-b/package.json -!/test/fixtures/commands/scan/plain-requirements-txt/requirements.txt -!/test/fixtures/commands/scan/simple-npm/index.js -!/test/fixtures/commands/scan/simple-npm/package.json -!/test/fixtures/commands/scan/uv-workspace/packages/api/pyproject.toml -!/test/fixtures/commands/scan/uv-workspace/packages/other/pyproject.toml -!/test/fixtures/commands/scan/uv-workspace/packages/shared/pyproject.toml -!/test/fixtures/commands/scan/uv-workspace/pyproject.toml -!/test/fixtures/commands/scan/uv-workspace/uv.lock -!/test/fixtures/manifest-bazel/bzlmod-only/MODULE.bazel -!/test/fixtures/manifest-bazel/custom-name-bzlmod/MODULE.bazel -!/test/fixtures/manifest-bazel/legacy-only/WORKSPACE -!/test/fixtures/manifest-bazel/legacy-with-load/WORKSPACE -!/test/fixtures/manifest-bazel/legacy-with-load/maven_deps.bzl -!/test/fixtures/manifest-bazel/migration/MODULE.bazel -!/test/fixtures/manifest-bazel/migration/WORKSPACE -!/test/fixtures/manifest-bazel/multi-repo-bzlmod/MODULE.bazel -!/test/fixtures/manifest-bazel/native/bzlmod/.bazelversion -!/test/fixtures/manifest-bazel/native/bzlmod/BUILD.bazel -!/test/fixtures/manifest-bazel/native/bzlmod/MODULE.bazel -!/test/fixtures/manifest-bazel/native/maven.expected.json -!/test/fixtures/manifest-bazel/native/workspace/.bazelversion -!/test/fixtures/manifest-bazel/native/workspace/BUILD.bazel -!/test/fixtures/manifest-bazel/native/workspace/WORKSPACE -!/test/fixtures/manifest-bazel/python-pypi/requirements.expected.txt -!/test/glob.test.mts -!/test/json-output-validation.mts -!/test/manifest-reachability-assertions.test.mts -!/test/maven-compat-smoke-assertions.test.mts -!/test/mock-auth.mts -!/test/mock-auth.test.mts -!/test/mock-malware-api.mts -!/test/mock-malware-api.test.mts -!/test/package-environment.npm-version.test.mts -!/test/pin-readme-assets.test.mts -!/test/reachability-options.mts -!/test/release-add-unreleased.test.mts -!/test/release-availability.test.mts -!/test/release-approve-npm.test.mts -!/test/release-artifact-download.test.mts -!/test/release-prepare.test.mts -!/test/release-history.test.mts -!/test/release-open-pr.test.mts -!/test/release-npm-policy.test.mts -!/test/release-registry.test.mts -!/test/release-version.test.mts -!/test/release-workflow.test.mts -!/test/run-with-config.mts -!/test/script-run-main.test.mts -!/test/script-scope.test.mts -!/test/script-update.test.mts -!/test/setup-node.test.mts -!/test/setup-uv.test.mts -!/test/smoke.sh -!/test/upload-artifact.test.mts -!/test/unit/scripts/test/apple-signing.test.mts -!/test/utils.mts -!/test/utils.test.mts -!/test/workflow-actions.test.mts !/translations.json !/tsconfig.json diff --git a/eslint.config.js b/eslint.config.js index fec4727faa..4f2d9193a3 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -217,6 +217,7 @@ module.exports = [ // Allow configs. '*.config.mts', '.config/*.config.mts', + '.config/snapshot-path.mts', '.github/actions/repo/cache-downloads/*.mts', // Allow paths like src/utils/*.test.mts. 'src/*/*.test.mts', @@ -228,22 +229,29 @@ module.exports = [ 'test/*.mts', 'test/src/utils/*.test.mts', 'test/src/commands/logout/*.test.mts', + 'test/e2e/*.test.mts', + 'test/termless/utils/*.test.mts', 'test/unit/utils/*.test.mts', 'test/unit/github/actions/repo/cache-downloads/*.test.mts', 'test/lib/native/*.mts', - 'test/lib/optimize-svg.mts', 'test/lib/terminal/*.mts', + 'test/lib/termless/*.mts', 'test/unit/lib/*.test.mts', 'test/unit/lib/native/*.test.mts', 'test/unit/lib/terminal/*.test.mts', + 'test/unit/lib/termless/*.test.mts', 'test/unit/sea/*.test.mts', 'test/unit/sea/build/*.test.mts', 'test/native/commands/*.native.test.mts', 'test/unit/scripts/test/*.test.mts', + 'test/unit/scripts/refresh/*.test.mts', + 'test/unit/scripts/refresh/snapshots/*.test.mts', 'test/unit/scripts/*.test.mts', // Allow loose one-off scripts. 'scripts/*.mts', 'scripts/test/*.mts', + 'scripts/refresh/*.mts', + 'scripts/refresh/snapshots/*.mts', 'test/utils/*.mts', ], defaultProject: 'tsconfig.json', diff --git a/package.json b/package.json index 259f1758c3..98084b0a9e 100644 --- a/package.json +++ b/package.json @@ -48,9 +48,11 @@ "build:package-matrix": "node scripts/build-package-matrix.mts", "test:native": "node scripts/test/native.mts", "test:native:build": "node scripts/test/native.mts --build", - "snapshots": "node scripts/test/snapshots.mts", - "snapshots:update": "node scripts/test/snapshots.mts --update", - "snapshots:update:dep": "node scripts/test/snapshots.mts --update --dep", + "snapshots": "node scripts/refresh/snapshots.mts", + "snapshots:termless:refresh": "node scripts/refresh/snapshots.mts --update", + "snapshots:vite:refresh": "pnpm run test:unit:update", + "snapshots:refresh": "run-s snapshots:termless:refresh snapshots:vite:refresh", + "snapshots:refresh:dep": "node scripts/refresh/snapshots.mts --update --dep", "build:sea:internal:bootstrap": "rollup -c .config/rollup.sea.config.mjs", "check": "node scripts/check.mts", "check:lint": "dotenvx -q run -f .env.local -- eslint --report-unused-disable-directives .", @@ -148,6 +150,7 @@ "@socketsecurity/config": "3.0.1", "@socketsecurity/registry": "1.1.17", "@socketsecurity/sdk": "4.0.3", + "@termless/vterm": "0.11.0", "@termless/core": "0.11.0", "@termless/xtermjs": "0.11.0", "@types/blessed": "0.1.25", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6253e964d8..27eab6942e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -231,6 +231,9 @@ importers: '@termless/core': specifier: 0.11.0 version: 0.11.0(node-pty@1.2.0-beta.18) + '@termless/vterm': + specifier: 0.11.0 + version: 0.11.0(@termless/core@0.11.0(node-pty@1.2.0-beta.18)) '@termless/xtermjs': specifier: 0.11.0 version: 0.11.0(@termless/core@0.11.0(node-pty@1.2.0-beta.18)) @@ -2183,6 +2186,12 @@ packages: node-pty: optional: true + '@termless/vterm@0.11.0': + resolution: {integrity: sha512-+Mwoy7hRc5gloqGxojQbAuyBKcRslflI9D16oU/79jbukFg0RTDLPQXNXTjR39fY8JePSzNAu6qX8YChORp1aw==} + engines: {bun: '>=1.0.0', node: '>=23.6.0'} + peerDependencies: + '@termless/core': ^0.11.0 + '@termless/xtermjs@0.11.0': resolution: {integrity: sha512-0GL6F/65WIE11WKMBcw8nCb2fU+8yLfQJ1QE/0jH4NaFd7UROTbR8pdwzkaAZ2u9YVGXA1GFYAr+jBV/5EF7Uw==} engines: {bun: '>=1.0.0', node: '>=23.6.0'} @@ -5499,6 +5508,10 @@ packages: jsdom: optional: true + vterm.js@0.13.2: + resolution: {integrity: sha512-fhNiN1q1HZa2r4vY3WlVCCAg6VKvQvIa2/8f4qPfKiLZCUMzo1vOHzrk/140LdHK6pfsTm3OoMRtAw1lt9uZeA==} + engines: {node: '>=23.6.0'} + walk-up-path@4.0.0: resolution: {integrity: sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A==} engines: {node: 20 || >=22} @@ -7468,6 +7481,11 @@ snapshots: playwright: 1.65.0 upng-js: 2.1.0 + '@termless/vterm@0.11.0(@termless/core@0.11.0(node-pty@1.2.0-beta.18))': + dependencies: + '@termless/core': 0.11.0(node-pty@1.2.0-beta.18) + vterm.js: 0.13.2 + '@termless/xtermjs@0.11.0(@termless/core@0.11.0(node-pty@1.2.0-beta.18))': dependencies: '@termless/core': 0.11.0(node-pty@1.2.0-beta.18) @@ -11269,6 +11287,8 @@ snapshots: - tsx - yaml + vterm.js@0.13.2: {} + walk-up-path@4.0.0: {} webpack-virtual-modules@0.6.2: {} diff --git a/scripts/test/snapshots.mts b/scripts/refresh/snapshots.mts similarity index 93% rename from scripts/test/snapshots.mts rename to scripts/refresh/snapshots.mts index 0df903ca88..6c48e30f4e 100644 --- a/scripts/test/snapshots.mts +++ b/scripts/refresh/snapshots.mts @@ -7,11 +7,11 @@ import { SNAPSHOT_DEPENDENCIES, assertSnapshotDependenciesCurrent, normalizeSnapshotDependencyName, -} from './snapshot-dependencies.mts' +} from './snapshots/dependencies.mts' import { isMainModule } from '../lib/is-main-module.mts' import { runMain } from '../lib/run-main.mts' -import type { SnapshotDependencyName } from './snapshot-dependencies.mts' +import type { SnapshotDependencyName } from './snapshots/dependencies.mts' import type { ScriptMeta } from '../lib/run-main.mts' import type { SpawnSyncOptions } from 'node:child_process' @@ -31,8 +31,8 @@ export interface SnapshotOptions { function missingSnapshotDependencyError(): Error { return new Error( - 'Provide a dependency name. Usage: pnpm snapshots:update:dep . ' + - 'Examples: pnpm snapshots:update:dep coana, pnpm snapshots:update:dep socket-patch, or pnpm snapshots:update:dep patch. ' + + 'Provide a dependency name. Usage: pnpm snapshots:refresh:dep . ' + + 'Examples: pnpm snapshots:refresh:dep coana, pnpm snapshots:refresh:dep socket-patch, or pnpm snapshots:refresh:dep patch. ' + 'Socket Python CLI still needs a snapshot mapping. ' + `Currently mapped: ${Object.keys(SNAPSHOT_DEPENDENCIES).join(', ')}, socket-patch.`, ) @@ -94,7 +94,8 @@ export function terminalSnapshotArgs(update: boolean): string[] { 'run', '--config', '.config/vitest.terminal.config.mts', - 'test/unit/utils/self-update.terminal.test.mts', + 'test/e2e/termless.test.mts', + 'test/termless/utils/self-update.test.mts', ...(update ? ['--update'] : []), ] } @@ -273,14 +274,14 @@ export async function main(): Promise { const SCRIPT_META: ScriptMeta = { describe: 'builds, runs, and reports native terminal snapshot tests', help: `Usage: pnpm snapshots [--update|-u] - pnpm snapshots:update - pnpm snapshots:update:dep (coana, socket-patch, patch) + pnpm snapshots:termless:refresh + pnpm snapshots:refresh:dep (coana, socket-patch, patch) Builds the native CLI, runs the focused terminal screenshot tests, and writes a self-contained HTML report into a fresh build/native-test-artifacts folder. Pass --update or -u to update the native screenshot baselines. Use the dep command to rebuild and update only snapshots affected by a pinned tool, for - example: pnpm snapshots:update:dep socket-patch.`, + example: pnpm snapshots:refresh:dep socket-patch.`, } if (isMainModule(import.meta.url)) { diff --git a/scripts/test/snapshot-dependencies.mts b/scripts/refresh/snapshots/dependencies.mts similarity index 77% rename from scripts/test/snapshot-dependencies.mts rename to scripts/refresh/snapshots/dependencies.mts index 55d9927676..131a34a011 100644 --- a/scripts/test/snapshot-dependencies.mts +++ b/scripts/refresh/snapshots/dependencies.mts @@ -1,7 +1,7 @@ import { promises as fs } from 'node:fs' import path from 'node:path' -const ROOT = path.resolve(import.meta.dirname, '../..') +const ROOT = path.resolve(import.meta.dirname, '../../..') export interface SnapshotDependency { readonly packageName: string @@ -18,9 +18,9 @@ export const SNAPSHOT_DEPENDENCIES = { source: 'src/constants.mts', versionPattern: /const COANA_CLI_VERSION = ['"]([^'"]+)['"]/, snapshots: [ - 'test/native-snapshots/socket-help-fix.help.svg', - 'test/native-snapshots/socket-help-scan-create.help.svg', - 'test/native-snapshots/socket-help-scan-reach.help.svg', + 'test/snapshots/termless/cli.native.socket-help-fix.svg', + 'test/snapshots/termless/cli.native.socket-help-scan-create.svg', + 'test/snapshots/termless/cli.native.socket-help-scan-reach.svg', ], testNamePattern: 'captures native help for (fix|scan create|scan reach)', }, @@ -29,17 +29,17 @@ export const SNAPSHOT_DEPENDENCIES = { source: 'package.json', versionPattern: /"@socketsecurity\/socket-patch"\s*:\s*"([^"]+)"/, snapshots: [ - 'test/native-snapshots/socket-patch-apply-help.help.svg', - 'test/native-snapshots/socket-patch-rollback-help.help.svg', - 'test/native-snapshots/socket-patch-get-help.help.svg', - 'test/native-snapshots/socket-patch-scan-help.help.svg', - 'test/native-snapshots/socket-patch-list-help.help.svg', - 'test/native-snapshots/socket-patch-remove-help.help.svg', - 'test/native-snapshots/socket-patch-setup-help.help.svg', - 'test/native-snapshots/socket-patch-repair-help.help.svg', - 'test/native-snapshots/socket-patch-version.version.svg', + 'test/snapshots/termless/cli.native.socket-patch-apply-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-rollback-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-get-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-scan-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-list-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-remove-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-setup-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-repair-help.svg', + 'test/snapshots/termless/cli.native.socket-patch-version.svg', ], - versionSnapshots: ['test/native-snapshots/socket-patch-version.version.svg'], + versionSnapshots: ['test/snapshots/termless/cli.native.socket-patch-version.svg'], testNamePattern: 'captures bundled patch help for (apply|rollback|get|scan|list|remove|setup|repair)|captures bundled socket-patch version', }, @@ -122,7 +122,7 @@ export function snapshotDependencyUpdateHint( dependency => `Snapshot output for ${dependency.packageName}@${dependency.version} is stale:\n` + dependency.snapshots.map(snapshot => ` - ${snapshot}`).join('\n') + - `\nRun: pnpm snapshots:update:dep ${dependency.dependencyName}`, + `\nRun: pnpm snapshots:refresh:dep ${dependency.dependencyName}`, ) .join('\n\n') } diff --git a/scripts/test/native.mts b/scripts/test/native.mts index 2cb1184b4c..6d29f87264 100644 --- a/scripts/test/native.mts +++ b/scripts/test/native.mts @@ -9,7 +9,7 @@ import { persistNativeSigningReceipt, prepareNativeTestBinary, } from './apple-signing.mts' -import { assertSnapshotDependenciesCurrent } from './snapshot-dependencies.mts' +import { assertSnapshotDependenciesCurrent } from '../refresh/snapshots/dependencies.mts' import { isMainModule } from '../lib/is-main-module.mts' import { runMain } from '../lib/run-main.mts' diff --git a/src/sea/README.md b/src/sea/README.md index ba87b7661e..9d289293a3 100644 --- a/src/sea/README.md +++ b/src/sea/README.md @@ -59,7 +59,7 @@ Use the executable's `--version` output and the adjacent manifest's recorded Soc Use Node 26.13.0 and build the prototype on the host OS before running its native tests: -For the screenshot baseline workflow, run `pnpm snapshots` to rebuild and verify the focused screenshot suites, or `pnpm snapshots:update` (equivalent to `pnpm snapshots -u`) to update baselines. Both commands print the self-contained report path. +Run `pnpm snapshots` to verify the terminal screenshots and print the HTML report path. Use `pnpm snapshots:termless:refresh` to refresh the images, `pnpm snapshots:vite:refresh` for Vitest unit snapshots, or `pnpm snapshots:refresh` for both. ```sh pnpm build:sea -- --prototype diff --git a/test/e2e/termless.test.mts b/test/e2e/termless.test.mts new file mode 100644 index 0000000000..0c4b57b658 --- /dev/null +++ b/test/e2e/termless.test.mts @@ -0,0 +1,42 @@ +import { join } from 'node:path' + +import { createTerminal } from '@termless/core' +import { createVtermBackend } from '@termless/vterm' +import { onTestFinished, test } from 'vitest' + +import { + captureCheckpoint, + createRecording, + expectTerminalAnimation, +} from '../lib/termless/animation.mts' + +test('captures the node -e fixture before and after Enter', async () => { + const terminal = createTerminal({ + backend: createVtermBackend(), + cols: 48, + rows: 8, + }) + onTestFinished(() => terminal.close()) + const script = [ + "process.stdout.write('PTY fixture\\r\\n> ready')", + "process.stdin.once('data', () => { process.stdout.write('\\x1b[2J\\x1b[HEnter received\\r\\n'); process.exit(0) })", + ].join(';') + + await terminal.spawn([process.execPath, '-e', script]) + await terminal.waitFor('> ready', 5000) + const prompt = await captureCheckpoint(terminal, 'prompt') + + terminal.press('Enter') + await terminal.waitFor('Enter received', 5000) + const complete = await captureCheckpoint(terminal, 'after-enter') + + await expectTerminalAnimation(createRecording([prompt, complete]), { + flow: 'node-e-fixture', + expectedSequence: ['prompt', 'after-enter'], + snapshotsDir: join(process.cwd(), 'test/snapshots/termless'), + durations: [400, 400], + artifactsDir: + process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? + join(process.cwd(), 'build/native-test-artifacts'), + }) +}) diff --git a/test/lib/native/cli-harness.mts b/test/lib/native/cli-harness.mts index 8966d030cb..62fa21e864 100644 --- a/test/lib/native/cli-harness.mts +++ b/test/lib/native/cli-harness.mts @@ -9,7 +9,7 @@ import { captureCheckpoint, createRecording, expectTerminalAnimation, -} from '../terminal/animation.mts' +} from '../termless/animation.mts' import { normalizeBackendOutput } from '../terminal/output.mts' export interface NativeTestEnvironment { @@ -145,7 +145,7 @@ export async function captureFlow(options: { ) await expectTerminalAnimation(createRecording([checkpoint]), { flow, - snapshotsDir: path.join(process.cwd(), 'test/native-snapshots'), + snapshotsDir: path.join(process.cwd(), 'test/snapshots/termless'), artifactsDir: process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? path.join(process.cwd(), 'build/native-test-artifacts'), diff --git a/test/lib/terminal/animation.mts b/test/lib/termless/animation.mts similarity index 96% rename from test/lib/terminal/animation.mts rename to test/lib/termless/animation.mts index 58af1a97c2..1d46c256a0 100644 --- a/test/lib/terminal/animation.mts +++ b/test/lib/termless/animation.mts @@ -9,7 +9,7 @@ import { } from '@termless/core' import { expect } from 'vitest' -import { optimizeSvg } from '../optimize-svg.mts' +import { optimizeSvg } from './svgo.mts' import type { AnimationFrame, @@ -189,7 +189,7 @@ export function renderCaptured( // Pinned Termless 0.11.0 separates keyframe blocks with invalid semicolons, // which browsers use to discard later frames; repair only that generated CSS. -export function createTerminalAnimationSvg( +export function createTermlessAnimationSvg( frames: AnimationFrame[], options?: AnimationOptions, ): string { @@ -331,7 +331,7 @@ export async function expectTerminalAnimation( if (animationFrames.length > 1) { await writeFile( path.join(flowDir, 'animation.svg'), - createTerminalAnimationSvg(animationFrames), + createTermlessAnimationSvg(animationFrames), ) } await writeFile( @@ -351,6 +351,11 @@ export async function expectTerminalAnimation( } const isSnapshotUpdate = process.env['SOCKET_CLI_NATIVE_TEST_UPDATE_SNAPSHOTS'] === 'true' + const testPath = expect.getState().testPath + if (!testPath) { + throw new Error('Terminal snapshots require an active Vitest test file') + } + const owner = path.basename(testPath, '.test.mts') const baselineRasterizer = !isSnapshotUpdate ? await selectRasterizer('resvg') : undefined @@ -359,7 +364,7 @@ export async function expectTerminalAnimation( checkpoints.map(async checkpoint => { const svgPath = path.join( options.snapshotsDir, - `${options.flow}.${checkpoint.name}.svg`, + `${owner}.${options.flow}${checkpoints.length > 1 ? `.${checkpoint.name}` : ''}.svg`, ) if (baselineRasterizer) { const expectedSvg = await readFile(svgPath, 'utf8') diff --git a/test/lib/optimize-svg.mts b/test/lib/termless/svgo.mts similarity index 100% rename from test/lib/optimize-svg.mts rename to test/lib/termless/svgo.mts diff --git a/test/native/commands/cli-behavior.native.test.mts b/test/native/commands/cli-behavior.native.test.mts index 807f372481..ab235282f0 100644 --- a/test/native/commands/cli-behavior.native.test.mts +++ b/test/native/commands/cli-behavior.native.test.mts @@ -11,14 +11,14 @@ import { captureCheckpoint, createRecording, expectTerminalAnimation, -} from '../../lib/terminal/animation.mts' +} from '../../lib/termless/animation.mts' const binary = process.env['SOCKET_CLI_NATIVE_TEST_BINARY'] describe('native CLI behavior', () => { it('reads an explicit config value', async () => { await captureFlow({ - flow: 'behavior-config-get', + flow: 'config-get', checkpointName: 'output', args: ['config', 'get', 'defaultOrg'], expectedText: 'native-fixture', @@ -29,7 +29,7 @@ describe('native CLI behavior', () => { it('lists an explicit config without persisting it', async () => { await captureFlow({ - flow: 'behavior-config-list', + flow: 'config-list', checkpointName: 'output', args: ['config', 'list'], expectedText: 'native-fixture', @@ -41,7 +41,7 @@ describe('native CLI behavior', () => { it('rejects an unknown config key', async () => { await captureFlow({ - flow: 'behavior-config-invalid-key', + flow: 'config-invalid-key', checkpointName: 'output', args: ['config', 'get', 'invalid-native-key'], expectedText: 'invalid config key', @@ -51,7 +51,7 @@ describe('native CLI behavior', () => { it('shows a missing socket.json error in an isolated directory', async () => { await captureFlow({ - flow: 'behavior-json-missing', + flow: 'json-missing', checkpointName: 'output', args: ['json'], expectedText: 'Not found:', @@ -61,7 +61,7 @@ describe('native CLI behavior', () => { it('prints a seeded socket.json fixture', async () => { await captureFlow({ - flow: 'behavior-json-seeded', + flow: 'json-seeded', checkpointName: 'output', args: ['json'], expectedText: '"projectIgnorePaths"', @@ -77,7 +77,7 @@ describe('native CLI behavior', () => { it('validates wrapper mode before applying the dry-run guard', async () => { await captureFlow({ - flow: 'behavior-wrapper-on-dry-run', + flow: 'wrapper-on-dry-run', checkpointName: 'output', args: ['wrapper', 'on', '--dry-run'], expectedText: '[DryRun]', @@ -108,8 +108,8 @@ describe('native CLI behavior', () => { fixture.normalizer.flush() const canceled = await captureCheckpoint(fixture.terminal, 'canceled') await expectTerminalAnimation(createRecording([menu, selected, canceled]), { - flow: 'behavior-manifest-setup', - snapshotsDir: path.join(process.cwd(), 'test/native-snapshots'), + flow: 'manifest-setup', + snapshotsDir: path.join(process.cwd(), 'test/snapshots/termless'), artifactsDir: process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? path.join(process.cwd(), 'build/native-test-artifacts'), diff --git a/test/native/commands/cli.native.test.mts b/test/native/commands/cli.native.test.mts index dfd8bce2ca..8150d72ff6 100644 --- a/test/native/commands/cli.native.test.mts +++ b/test/native/commands/cli.native.test.mts @@ -18,14 +18,14 @@ import { captureCheckpoint, createRecording, expectTerminalAnimation, -} from '../../lib/terminal/animation.mts' +} from '../../lib/termless/animation.mts' const binary = process.env['SOCKET_CLI_NATIVE_TEST_BINARY'] if (!binary) { throw new Error('Use pnpm test:native to run native CLI tests') } -const snapshotDir = path.join(process.cwd(), 'test/native-snapshots') +const snapshotDir = path.join(process.cwd(), 'test/snapshots/termless') const artifactDir = process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? path.join(process.cwd(), 'build/native-test-artifacts') diff --git a/test/native/commands/tui.native.test.mts b/test/native/commands/tui.native.test.mts index 8b87b1a9b8..7d1d50e6c2 100644 --- a/test/native/commands/tui.native.test.mts +++ b/test/native/commands/tui.native.test.mts @@ -8,14 +8,14 @@ import { captureCheckpoint, createRecording, expectTerminalAnimation, -} from '../../lib/terminal/animation.mts' +} from '../../lib/termless/animation.mts' const binary = process.env['SOCKET_CLI_NATIVE_TEST_BINARY'] if (!binary) { throw new Error('Use pnpm test:native to run native CLI tests') } -const snapshotDir = path.join(process.cwd(), 'test/native-snapshots') +const snapshotDir = path.join(process.cwd(), 'test/snapshots/termless') const artifactDir = process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? path.join(process.cwd(), 'build/native-test-artifacts') @@ -57,7 +57,7 @@ describe('native blessed terminal interfaces', () => { .toBe('exit=0') normalizer.flush() await expectTerminalAnimation(createRecording([checkpoint]), { - flow: 'native-analytics-tui', + flow: 'analytics', snapshotsDir: snapshotDir, artifactsDir: artifactDir, expectedSequence: ['charts'], @@ -81,7 +81,7 @@ describe('native blessed terminal interfaces', () => { .toBe('exit=0') normalizer.flush() await expectTerminalAnimation(createRecording([checkpoint]), { - flow: 'native-audit-log-tui', + flow: 'audit-log', snapshotsDir: snapshotDir, artifactsDir: artifactDir, expectedSequence: ['table'], @@ -105,7 +105,7 @@ describe('native blessed terminal interfaces', () => { .toBe('exit=0') normalizer.flush() await expectTerminalAnimation(createRecording([checkpoint]), { - flow: 'native-threat-feed-tui', + flow: 'threat-feed', snapshotsDir: snapshotDir, artifactsDir: artifactDir, expectedSequence: ['table'], diff --git a/test/snapshots/.gitattributes b/test/snapshots/.gitattributes new file mode 100644 index 0000000000..d663dead6f --- /dev/null +++ b/test/snapshots/.gitattributes @@ -0,0 +1,2 @@ +*.svg binary linguist-generated=true +*.png binary linguist-generated=true diff --git a/test/native-snapshots/behavior-config-get.output.svg b/test/snapshots/termless/cli-behavior.native.config-get.svg similarity index 100% rename from test/native-snapshots/behavior-config-get.output.svg rename to test/snapshots/termless/cli-behavior.native.config-get.svg diff --git a/test/native-snapshots/behavior-config-invalid-key.output.svg b/test/snapshots/termless/cli-behavior.native.config-invalid-key.svg similarity index 100% rename from test/native-snapshots/behavior-config-invalid-key.output.svg rename to test/snapshots/termless/cli-behavior.native.config-invalid-key.svg diff --git a/test/native-snapshots/behavior-config-list.output.svg b/test/snapshots/termless/cli-behavior.native.config-list.svg similarity index 100% rename from test/native-snapshots/behavior-config-list.output.svg rename to test/snapshots/termless/cli-behavior.native.config-list.svg diff --git a/test/native-snapshots/behavior-json-missing.output.svg b/test/snapshots/termless/cli-behavior.native.json-missing.svg similarity index 100% rename from test/native-snapshots/behavior-json-missing.output.svg rename to test/snapshots/termless/cli-behavior.native.json-missing.svg diff --git a/test/native-snapshots/behavior-json-seeded.output.svg b/test/snapshots/termless/cli-behavior.native.json-seeded.svg similarity index 100% rename from test/native-snapshots/behavior-json-seeded.output.svg rename to test/snapshots/termless/cli-behavior.native.json-seeded.svg diff --git a/test/native-snapshots/behavior-manifest-setup.canceled.svg b/test/snapshots/termless/cli-behavior.native.manifest-setup.canceled.svg similarity index 100% rename from test/native-snapshots/behavior-manifest-setup.canceled.svg rename to test/snapshots/termless/cli-behavior.native.manifest-setup.canceled.svg diff --git a/test/native-snapshots/behavior-manifest-setup.exit-selected.svg b/test/snapshots/termless/cli-behavior.native.manifest-setup.exit-selected.svg similarity index 100% rename from test/native-snapshots/behavior-manifest-setup.exit-selected.svg rename to test/snapshots/termless/cli-behavior.native.manifest-setup.exit-selected.svg diff --git a/test/native-snapshots/behavior-manifest-setup.menu.svg b/test/snapshots/termless/cli-behavior.native.manifest-setup.menu.svg similarity index 100% rename from test/native-snapshots/behavior-manifest-setup.menu.svg rename to test/snapshots/termless/cli-behavior.native.manifest-setup.menu.svg diff --git a/test/native-snapshots/behavior-wrapper-on-dry-run.output.svg b/test/snapshots/termless/cli-behavior.native.wrapper-on-dry-run.svg similarity index 100% rename from test/native-snapshots/behavior-wrapper-on-dry-run.output.svg rename to test/snapshots/termless/cli-behavior.native.wrapper-on-dry-run.svg diff --git a/test/native-snapshots/socket-cdxgen-unsupported-type.unsupported-type.svg b/test/snapshots/termless/cli.native.socket-cdxgen-unsupported-type.svg similarity index 100% rename from test/native-snapshots/socket-cdxgen-unsupported-type.unsupported-type.svg rename to test/snapshots/termless/cli.native.socket-cdxgen-unsupported-type.svg diff --git a/test/native-snapshots/socket-help-analytics.help.svg b/test/snapshots/termless/cli.native.socket-help-analytics.svg similarity index 100% rename from test/native-snapshots/socket-help-analytics.help.svg rename to test/snapshots/termless/cli.native.socket-help-analytics.svg diff --git a/test/native-snapshots/socket-help-audit-log.help.svg b/test/snapshots/termless/cli.native.socket-help-audit-log.svg similarity index 100% rename from test/native-snapshots/socket-help-audit-log.help.svg rename to test/snapshots/termless/cli.native.socket-help-audit-log.svg diff --git a/test/native-snapshots/socket-help-cdxgen.help.svg b/test/snapshots/termless/cli.native.socket-help-cdxgen.svg similarity index 100% rename from test/native-snapshots/socket-help-cdxgen.help.svg rename to test/snapshots/termless/cli.native.socket-help-cdxgen.svg diff --git a/test/native-snapshots/socket-help-ci.help.svg b/test/snapshots/termless/cli.native.socket-help-ci.svg similarity index 100% rename from test/native-snapshots/socket-help-ci.help.svg rename to test/snapshots/termless/cli.native.socket-help-ci.svg diff --git a/test/native-snapshots/socket-help-config-auto.help.svg b/test/snapshots/termless/cli.native.socket-help-config-auto.svg similarity index 100% rename from test/native-snapshots/socket-help-config-auto.help.svg rename to test/snapshots/termless/cli.native.socket-help-config-auto.svg diff --git a/test/native-snapshots/socket-help-config-get.help.svg b/test/snapshots/termless/cli.native.socket-help-config-get.svg similarity index 100% rename from test/native-snapshots/socket-help-config-get.help.svg rename to test/snapshots/termless/cli.native.socket-help-config-get.svg diff --git a/test/native-snapshots/socket-help-config-list.help.svg b/test/snapshots/termless/cli.native.socket-help-config-list.svg similarity index 100% rename from test/native-snapshots/socket-help-config-list.help.svg rename to test/snapshots/termless/cli.native.socket-help-config-list.svg diff --git a/test/native-snapshots/socket-help-config-set.help.svg b/test/snapshots/termless/cli.native.socket-help-config-set.svg similarity index 100% rename from test/native-snapshots/socket-help-config-set.help.svg rename to test/snapshots/termless/cli.native.socket-help-config-set.svg diff --git a/test/native-snapshots/socket-help-config-unset.help.svg b/test/snapshots/termless/cli.native.socket-help-config-unset.svg similarity index 100% rename from test/native-snapshots/socket-help-config-unset.help.svg rename to test/snapshots/termless/cli.native.socket-help-config-unset.svg diff --git a/test/native-snapshots/socket-help-config.help.svg b/test/snapshots/termless/cli.native.socket-help-config.svg similarity index 100% rename from test/native-snapshots/socket-help-config.help.svg rename to test/snapshots/termless/cli.native.socket-help-config.svg diff --git a/test/native-snapshots/socket-help-dependencies.help.svg b/test/snapshots/termless/cli.native.socket-help-dependencies.svg similarity index 100% rename from test/native-snapshots/socket-help-dependencies.help.svg rename to test/snapshots/termless/cli.native.socket-help-dependencies.svg diff --git a/test/native-snapshots/socket-help-fix.help.svg b/test/snapshots/termless/cli.native.socket-help-fix.svg similarity index 100% rename from test/native-snapshots/socket-help-fix.help.svg rename to test/snapshots/termless/cli.native.socket-help-fix.svg diff --git a/test/native-snapshots/socket-help-install-completion.help.svg b/test/snapshots/termless/cli.native.socket-help-install-completion.svg similarity index 100% rename from test/native-snapshots/socket-help-install-completion.help.svg rename to test/snapshots/termless/cli.native.socket-help-install-completion.svg diff --git a/test/native-snapshots/socket-help-install.help.svg b/test/snapshots/termless/cli.native.socket-help-install.svg similarity index 100% rename from test/native-snapshots/socket-help-install.help.svg rename to test/snapshots/termless/cli.native.socket-help-install.svg diff --git a/test/native-snapshots/socket-help-json.help.svg b/test/snapshots/termless/cli.native.socket-help-json.svg similarity index 100% rename from test/native-snapshots/socket-help-json.help.svg rename to test/snapshots/termless/cli.native.socket-help-json.svg diff --git a/test/native-snapshots/socket-help-license.help.svg b/test/snapshots/termless/cli.native.socket-help-license.svg similarity index 100% rename from test/native-snapshots/socket-help-license.help.svg rename to test/snapshots/termless/cli.native.socket-help-license.svg diff --git a/test/native-snapshots/socket-help-login.help.svg b/test/snapshots/termless/cli.native.socket-help-login.svg similarity index 100% rename from test/native-snapshots/socket-help-login.help.svg rename to test/snapshots/termless/cli.native.socket-help-login.svg diff --git a/test/native-snapshots/socket-help-logout.help.svg b/test/snapshots/termless/cli.native.socket-help-logout.svg similarity index 100% rename from test/native-snapshots/socket-help-logout.help.svg rename to test/snapshots/termless/cli.native.socket-help-logout.svg diff --git a/test/native-snapshots/socket-help-manifest-auto.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-auto.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-auto.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-auto.svg diff --git a/test/native-snapshots/socket-help-manifest-bazel.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-bazel.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-bazel.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-bazel.svg diff --git a/test/native-snapshots/socket-help-manifest-cdxgen.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-cdxgen.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-cdxgen.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-cdxgen.svg diff --git a/test/native-snapshots/socket-help-manifest-conda.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-conda.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-conda.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-conda.svg diff --git a/test/native-snapshots/socket-help-manifest-dotnet.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-dotnet.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-dotnet.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-dotnet.svg diff --git a/test/native-snapshots/socket-help-manifest-dynamic-sbom-inference.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-dynamic-sbom-inference.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-dynamic-sbom-inference.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-dynamic-sbom-inference.svg diff --git a/test/native-snapshots/socket-help-manifest-gradle.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-gradle.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-gradle.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-gradle.svg diff --git a/test/native-snapshots/socket-help-manifest-kotlin.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-kotlin.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-kotlin.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-kotlin.svg diff --git a/test/native-snapshots/socket-help-manifest-maven.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-maven.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-maven.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-maven.svg diff --git a/test/native-snapshots/socket-help-manifest-scala.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-scala.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-scala.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-scala.svg diff --git a/test/native-snapshots/socket-help-manifest-setup.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest-setup.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest-setup.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest-setup.svg diff --git a/test/native-snapshots/socket-help-manifest.help.svg b/test/snapshots/termless/cli.native.socket-help-manifest.svg similarity index 100% rename from test/native-snapshots/socket-help-manifest.help.svg rename to test/snapshots/termless/cli.native.socket-help-manifest.svg diff --git a/test/native-snapshots/socket-help-npm.help.svg b/test/snapshots/termless/cli.native.socket-help-npm.svg similarity index 100% rename from test/native-snapshots/socket-help-npm.help.svg rename to test/snapshots/termless/cli.native.socket-help-npm.svg diff --git a/test/native-snapshots/socket-help-npx.help.svg b/test/snapshots/termless/cli.native.socket-help-npx.svg similarity index 100% rename from test/native-snapshots/socket-help-npx.help.svg rename to test/snapshots/termless/cli.native.socket-help-npx.svg diff --git a/test/native-snapshots/socket-help-oops.help.svg b/test/snapshots/termless/cli.native.socket-help-oops.svg similarity index 100% rename from test/native-snapshots/socket-help-oops.help.svg rename to test/snapshots/termless/cli.native.socket-help-oops.svg diff --git a/test/native-snapshots/socket-help-optimize.help.svg b/test/snapshots/termless/cli.native.socket-help-optimize.svg similarity index 100% rename from test/native-snapshots/socket-help-optimize.help.svg rename to test/snapshots/termless/cli.native.socket-help-optimize.svg diff --git a/test/native-snapshots/socket-help-organization-dependencies.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-dependencies.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-dependencies.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-dependencies.svg diff --git a/test/native-snapshots/socket-help-organization-list.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-list.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-list.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-list.svg diff --git a/test/native-snapshots/socket-help-organization-policy-license.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-policy-license.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-policy-license.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-policy-license.svg diff --git a/test/native-snapshots/socket-help-organization-policy-security.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-policy-security.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-policy-security.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-policy-security.svg diff --git a/test/native-snapshots/socket-help-organization-policy.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-policy.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-policy.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-policy.svg diff --git a/test/native-snapshots/socket-help-organization-quota.help.svg b/test/snapshots/termless/cli.native.socket-help-organization-quota.svg similarity index 100% rename from test/native-snapshots/socket-help-organization-quota.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization-quota.svg diff --git a/test/native-snapshots/socket-help-organization.help.svg b/test/snapshots/termless/cli.native.socket-help-organization.svg similarity index 100% rename from test/native-snapshots/socket-help-organization.help.svg rename to test/snapshots/termless/cli.native.socket-help-organization.svg diff --git a/test/native-snapshots/socket-help-package-score.help.svg b/test/snapshots/termless/cli.native.socket-help-package-score.svg similarity index 100% rename from test/native-snapshots/socket-help-package-score.help.svg rename to test/snapshots/termless/cli.native.socket-help-package-score.svg diff --git a/test/native-snapshots/socket-help-package-shallow.help.svg b/test/snapshots/termless/cli.native.socket-help-package-shallow.svg similarity index 100% rename from test/native-snapshots/socket-help-package-shallow.help.svg rename to test/snapshots/termless/cli.native.socket-help-package-shallow.svg diff --git a/test/native-snapshots/socket-help-package.help.svg b/test/snapshots/termless/cli.native.socket-help-package.svg similarity index 100% rename from test/native-snapshots/socket-help-package.help.svg rename to test/snapshots/termless/cli.native.socket-help-package.svg diff --git a/test/native-snapshots/socket-help-patch.help.svg b/test/snapshots/termless/cli.native.socket-help-patch.svg similarity index 100% rename from test/native-snapshots/socket-help-patch.help.svg rename to test/snapshots/termless/cli.native.socket-help-patch.svg diff --git a/test/native-snapshots/socket-help-pnpm.help.svg b/test/snapshots/termless/cli.native.socket-help-pnpm.svg similarity index 100% rename from test/native-snapshots/socket-help-pnpm.help.svg rename to test/snapshots/termless/cli.native.socket-help-pnpm.svg diff --git a/test/native-snapshots/socket-help-raw-npm.help.svg b/test/snapshots/termless/cli.native.socket-help-raw-npm.svg similarity index 100% rename from test/native-snapshots/socket-help-raw-npm.help.svg rename to test/snapshots/termless/cli.native.socket-help-raw-npm.svg diff --git a/test/native-snapshots/socket-help-raw-npx.help.svg b/test/snapshots/termless/cli.native.socket-help-raw-npx.svg similarity index 100% rename from test/native-snapshots/socket-help-raw-npx.help.svg rename to test/snapshots/termless/cli.native.socket-help-raw-npx.svg diff --git a/test/native-snapshots/socket-help-repository-create.help.svg b/test/snapshots/termless/cli.native.socket-help-repository-create.svg similarity index 100% rename from test/native-snapshots/socket-help-repository-create.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository-create.svg diff --git a/test/native-snapshots/socket-help-repository-del.help.svg b/test/snapshots/termless/cli.native.socket-help-repository-del.svg similarity index 100% rename from test/native-snapshots/socket-help-repository-del.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository-del.svg diff --git a/test/native-snapshots/socket-help-repository-list.help.svg b/test/snapshots/termless/cli.native.socket-help-repository-list.svg similarity index 100% rename from test/native-snapshots/socket-help-repository-list.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository-list.svg diff --git a/test/native-snapshots/socket-help-repository-update.help.svg b/test/snapshots/termless/cli.native.socket-help-repository-update.svg similarity index 100% rename from test/native-snapshots/socket-help-repository-update.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository-update.svg diff --git a/test/native-snapshots/socket-help-repository-view.help.svg b/test/snapshots/termless/cli.native.socket-help-repository-view.svg similarity index 100% rename from test/native-snapshots/socket-help-repository-view.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository-view.svg diff --git a/test/native-snapshots/socket-help-repository.help.svg b/test/snapshots/termless/cli.native.socket-help-repository.svg similarity index 100% rename from test/native-snapshots/socket-help-repository.help.svg rename to test/snapshots/termless/cli.native.socket-help-repository.svg diff --git a/test/native-snapshots/socket-help-scan-create.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-create.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-create.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-create.svg diff --git a/test/native-snapshots/socket-help-scan-del.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-del.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-del.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-del.svg diff --git a/test/native-snapshots/socket-help-scan-diff.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-diff.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-diff.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-diff.svg diff --git a/test/native-snapshots/socket-help-scan-github.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-github.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-github.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-github.svg diff --git a/test/native-snapshots/socket-help-scan-list.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-list.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-list.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-list.svg diff --git a/test/native-snapshots/socket-help-scan-metadata.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-metadata.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-metadata.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-metadata.svg diff --git a/test/native-snapshots/socket-help-scan-reach.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-reach.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-reach.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-reach.svg diff --git a/test/native-snapshots/socket-help-scan-report.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-report.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-report.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-report.svg diff --git a/test/native-snapshots/socket-help-scan-setup.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-setup.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-setup.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-setup.svg diff --git a/test/native-snapshots/socket-help-scan-view.help.svg b/test/snapshots/termless/cli.native.socket-help-scan-view.svg similarity index 100% rename from test/native-snapshots/socket-help-scan-view.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan-view.svg diff --git a/test/native-snapshots/socket-help-scan.help.svg b/test/snapshots/termless/cli.native.socket-help-scan.svg similarity index 100% rename from test/native-snapshots/socket-help-scan.help.svg rename to test/snapshots/termless/cli.native.socket-help-scan.svg diff --git a/test/native-snapshots/socket-help-security.help.svg b/test/snapshots/termless/cli.native.socket-help-security.svg similarity index 100% rename from test/native-snapshots/socket-help-security.help.svg rename to test/snapshots/termless/cli.native.socket-help-security.svg diff --git a/test/native-snapshots/socket-help-threat-feed.help.svg b/test/snapshots/termless/cli.native.socket-help-threat-feed.svg similarity index 100% rename from test/native-snapshots/socket-help-threat-feed.help.svg rename to test/snapshots/termless/cli.native.socket-help-threat-feed.svg diff --git a/test/native-snapshots/socket-help-uninstall-completion.help.svg b/test/snapshots/termless/cli.native.socket-help-uninstall-completion.svg similarity index 100% rename from test/native-snapshots/socket-help-uninstall-completion.help.svg rename to test/snapshots/termless/cli.native.socket-help-uninstall-completion.svg diff --git a/test/native-snapshots/socket-help-uninstall.help.svg b/test/snapshots/termless/cli.native.socket-help-uninstall.svg similarity index 100% rename from test/native-snapshots/socket-help-uninstall.help.svg rename to test/snapshots/termless/cli.native.socket-help-uninstall.svg diff --git a/test/native-snapshots/socket-help-wrapper.help.svg b/test/snapshots/termless/cli.native.socket-help-wrapper.svg similarity index 100% rename from test/native-snapshots/socket-help-wrapper.help.svg rename to test/snapshots/termless/cli.native.socket-help-wrapper.svg diff --git a/test/native-snapshots/socket-help-yarn.help.svg b/test/snapshots/termless/cli.native.socket-help-yarn.svg similarity index 100% rename from test/native-snapshots/socket-help-yarn.help.svg rename to test/snapshots/termless/cli.native.socket-help-yarn.svg diff --git a/test/native-snapshots/socket-help.help.svg b/test/snapshots/termless/cli.native.socket-help.svg similarity index 100% rename from test/native-snapshots/socket-help.help.svg rename to test/snapshots/termless/cli.native.socket-help.svg diff --git a/test/native-snapshots/socket-manifest-dry-run.dry-run.svg b/test/snapshots/termless/cli.native.socket-manifest-dry-run.svg similarity index 100% rename from test/native-snapshots/socket-manifest-dry-run.dry-run.svg rename to test/snapshots/termless/cli.native.socket-manifest-dry-run.svg diff --git a/test/native-snapshots/socket-patch-apply-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-apply-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-apply-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-apply-help.svg diff --git a/test/native-snapshots/socket-patch-get-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-get-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-get-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-get-help.svg diff --git a/test/native-snapshots/socket-patch-list-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-list-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-list-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-list-help.svg diff --git a/test/native-snapshots/socket-patch-remove-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-remove-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-remove-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-remove-help.svg diff --git a/test/native-snapshots/socket-patch-repair-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-repair-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-repair-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-repair-help.svg diff --git a/test/native-snapshots/socket-patch-rollback-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-rollback-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-rollback-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-rollback-help.svg diff --git a/test/native-snapshots/socket-patch-scan-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-scan-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-scan-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-scan-help.svg diff --git a/test/native-snapshots/socket-patch-setup-help.help.svg b/test/snapshots/termless/cli.native.socket-patch-setup-help.svg similarity index 100% rename from test/native-snapshots/socket-patch-setup-help.help.svg rename to test/snapshots/termless/cli.native.socket-patch-setup-help.svg diff --git a/test/native-snapshots/socket-patch-version.version.svg b/test/snapshots/termless/cli.native.socket-patch-version.svg similarity index 100% rename from test/native-snapshots/socket-patch-version.version.svg rename to test/snapshots/termless/cli.native.socket-patch-version.svg diff --git a/test/native-snapshots/socket-scan-setup.canceled.svg b/test/snapshots/termless/cli.native.socket-scan-setup.canceled.svg similarity index 100% rename from test/native-snapshots/socket-scan-setup.canceled.svg rename to test/snapshots/termless/cli.native.socket-scan-setup.canceled.svg diff --git a/test/native-snapshots/socket-scan-setup.github-selected.svg b/test/snapshots/termless/cli.native.socket-scan-setup.github-selected.svg similarity index 100% rename from test/native-snapshots/socket-scan-setup.github-selected.svg rename to test/snapshots/termless/cli.native.socket-scan-setup.github-selected.svg diff --git a/test/native-snapshots/socket-scan-setup.menu.svg b/test/snapshots/termless/cli.native.socket-scan-setup.menu.svg similarity index 100% rename from test/native-snapshots/socket-scan-setup.menu.svg rename to test/snapshots/termless/cli.native.socket-scan-setup.menu.svg diff --git a/test/native-snapshots/socket-version.version.svg b/test/snapshots/termless/cli.native.socket-version.svg similarity index 100% rename from test/native-snapshots/socket-version.version.svg rename to test/snapshots/termless/cli.native.socket-version.svg diff --git a/test/native-snapshots/self-update-notice-standard.standard.svg b/test/snapshots/termless/self-update.notice-standard.svg similarity index 100% rename from test/native-snapshots/self-update-notice-standard.standard.svg rename to test/snapshots/termless/self-update.notice-standard.svg diff --git a/test/native-snapshots/self-update-notice-wide.wide.svg b/test/snapshots/termless/self-update.notice-wide.svg similarity index 100% rename from test/native-snapshots/self-update-notice-wide.wide.svg rename to test/snapshots/termless/self-update.notice-wide.svg diff --git a/test/native-snapshots/self-update-notice-wrapped.wrapped.svg b/test/snapshots/termless/self-update.notice-wrapped.svg similarity index 100% rename from test/native-snapshots/self-update-notice-wrapped.wrapped.svg rename to test/snapshots/termless/self-update.notice-wrapped.svg diff --git a/test/native-snapshots/self-update-suppressed.suppressed.svg b/test/snapshots/termless/self-update.suppressed.svg similarity index 100% rename from test/native-snapshots/self-update-suppressed.suppressed.svg rename to test/snapshots/termless/self-update.suppressed.svg diff --git a/test/snapshots/termless/termless.node-e-fixture.after-enter.svg b/test/snapshots/termless/termless.node-e-fixture.after-enter.svg new file mode 100644 index 0000000000..827f69a95e --- /dev/null +++ b/test/snapshots/termless/termless.node-e-fixture.after-enter.svg @@ -0,0 +1,9 @@ + +Enter received + + + + + + + \ No newline at end of file diff --git a/test/snapshots/termless/termless.node-e-fixture.prompt.svg b/test/snapshots/termless/termless.node-e-fixture.prompt.svg new file mode 100644 index 0000000000..d80160dd58 --- /dev/null +++ b/test/snapshots/termless/termless.node-e-fixture.prompt.svg @@ -0,0 +1,9 @@ + +PTY fixture + +> ready + + + + + \ No newline at end of file diff --git a/test/native-snapshots/native-analytics-tui.charts.svg b/test/snapshots/termless/tui.native.analytics.svg similarity index 100% rename from test/native-snapshots/native-analytics-tui.charts.svg rename to test/snapshots/termless/tui.native.analytics.svg diff --git a/test/native-snapshots/native-audit-log-tui.table.svg b/test/snapshots/termless/tui.native.audit-log.svg similarity index 100% rename from test/native-snapshots/native-audit-log-tui.table.svg rename to test/snapshots/termless/tui.native.audit-log.svg diff --git a/test/native-snapshots/native-threat-feed-tui.table.svg b/test/snapshots/termless/tui.native.threat-feed.svg similarity index 100% rename from test/native-snapshots/native-threat-feed-tui.table.svg rename to test/snapshots/termless/tui.native.threat-feed.svg diff --git a/test/unit/utils/self-update.terminal.test.mts b/test/termless/utils/self-update.test.mts similarity index 95% rename from test/unit/utils/self-update.terminal.test.mts rename to test/termless/utils/self-update.test.mts index 167f9e6837..962a32003c 100644 --- a/test/unit/utils/self-update.terminal.test.mts +++ b/test/termless/utils/self-update.test.mts @@ -11,7 +11,7 @@ import { captureCheckpoint, createRecording, expectTerminalAnimation, -} from '../../lib/terminal/animation.mts' +} from '../../lib/termless/animation.mts' const { loggerLog } = vi.hoisted(() => ({ loggerLog: vi.fn() })) @@ -27,7 +27,7 @@ vi.mock('@socketsecurity/registry/lib/logger', () => ({ logger: { log: loggerLog }, })) -const snapshotsDir = path.join(process.cwd(), 'test/native-snapshots') +const snapshotsDir = path.join(process.cwd(), 'test/snapshots/termless') const artifactsDir = process.env['SOCKET_CLI_NATIVE_TEST_ARTIFACTS'] ?? path.join(process.cwd(), 'build/native-test-artifacts') @@ -78,7 +78,7 @@ describe('self-update terminal notice screenshot', () => { expect(terminal.screen.getText()).not.toContain('Socket 1.0.0 → 1.1.0.') const checkpoint = await captureCheckpoint(terminal, 'suppressed') await expectTerminalAnimation(createRecording([checkpoint]), { - flow: 'self-update-suppressed', + flow: 'suppressed', snapshotsDir, artifactsDir, expectedSequence: ['suppressed'], @@ -107,7 +107,7 @@ async function captureNoticeAtWidth(cols: number, name: string): Promise { expect(terminal.screen.getText()).toContain('Socket 1.0.0 → 1.1.0.') const checkpoint = await captureCheckpoint(terminal, name) await expectTerminalAnimation(createRecording([checkpoint]), { - flow: `self-update-notice-${name}`, + flow: `notice-${name}`, snapshotsDir, artifactsDir, expectedSequence: [name], diff --git a/test/unit/lib/terminal/animation.test.mts b/test/unit/lib/termless/animation.test.mts similarity index 98% rename from test/unit/lib/terminal/animation.test.mts rename to test/unit/lib/termless/animation.test.mts index 32c8bb584f..59a7e4084f 100644 --- a/test/unit/lib/terminal/animation.test.mts +++ b/test/unit/lib/termless/animation.test.mts @@ -11,13 +11,13 @@ import { captureCheckpoint, createBlankCell, createRecording, - createTerminalAnimationSvg, + createTermlessAnimationSvg, emptyCell, expectTerminalAnimation, findLastOccupiedRow, isVisiblyOccupied, renderCaptured, -} from '../../../lib/terminal/animation.mts' +} from '../../../lib/termless/animation.mts' import type { AnimationFrame } from '@termless/core' @@ -37,7 +37,7 @@ describe('terminal animation recorder', () => { duration: 400, }, ] - const svg = createTerminalAnimationSvg(frames) + const svg = createTermlessAnimationSvg(frames) for (const text of ['frame-one', 'frame-two', 'frame-three']) { expect(svg).toContain(text) } diff --git a/test/unit/lib/optimize-svg.test.mts b/test/unit/lib/termless/svgo.test.mts similarity index 97% rename from test/unit/lib/optimize-svg.test.mts rename to test/unit/lib/termless/svgo.test.mts index d0160a7893..0a83703d38 100644 --- a/test/unit/lib/optimize-svg.test.mts +++ b/test/unit/lib/termless/svgo.test.mts @@ -1,7 +1,7 @@ import { selectRasterizer } from '@termless/core' import { describe, expect, it } from 'vitest' -import { optimizeSvg } from '../../lib/optimize-svg.mts' +import { optimizeSvg } from '../../../lib/termless/svgo.mts' const extractStyle = (svg: string) => svg.match(/