Aer Test

aer test

Run test methods in Apex source from one or more directories

aer test [directories...] [flags]

Options

      --all-exceptions              show details about all caught exceptions
  -p, --assign-perms strings        assign permission sets to the default sandbox user (canonical Name or NamespacePrefix__Name, repeatable)
      --assign-psg strings          assign permission set groups to the default sandbox user (canonical DeveloperName or NamespacePrefix__DeveloperName, repeatable)
      --bootstrap-db string         bootstrap SQLite database to seed before running tests
      --bootstrap-tables strings    comma-separated list of tables to copy from bootstrap database (default: all tables)
      --certificate strings         load a PEM-encoded certificate key file; the certificate name is derived from the filename (extension stripped; repeatable)
      --certificate-dir strings     load every PEM file (.pem/.crt/.cer/.key) in a directory as certificate keys named after their filenames (repeatable)
      --certificate-key strings     associate a certificate developer name with an inline base64-encoded PEM key (format: CertName=BASE64; e.g. the output of 'openssl base64 -A'; repeatable)
      --coverage string             write Apex code coverage to file
      --coverage-format string      coverage output format: cobertura, json (default: auto-detect from file extension)
      --coverage-per-test           include each test method's covered and uncovered lines in --json records (requires --json)
      --critical                    include tests marked @IsTest(critical=true); when used alone, runs only critical tests
      --currency string             org default currency ISO code (e.g., USD, EUR, GBP)
      --db string                   database to use: a SQLite file path, a postgres:// DSN, or postgresqltest:// for an ephemeral PostgreSQL server (default: in-memory SQLite)
      --debug                       enable DAP debug mode
  -d, --default-namespace string    treat loaded code as if it belongs to the specified namespace
  -n, --dry-run                     show tests that would be run without executing them
      --faketime string             starting time for DateTime.now() and Date.today(); time advances normally from this point (RFC3339 format, e.g., 2025-10-26T18:00:00-05:00)
      --feature strings             enable optional features (PersonAccounts, HealthCloud, LiveAgent, OmniChannel, MultiCurrency, FinancialServicesCloud, B2BCommerce, RevenueCloud, LifeSciencesCloud, ConsumerGoodsCloud, ManufacturingCloud, Scheduler, CRMAnalytics, PrivacyCenter, ExperienceCloud, FieldService, Knowledge, EducationCloud, HighVelocitySales, WorkplaceCommandCenter, StateAndCountryPicklist, Division)
  -f, --filter strings              filter tests by name (substring match or glob pattern, can be specified multiple times)
      --filter-path strings         filter tests by source file path (prefix match or glob pattern with ** support)
      --for strings                 run tests marked @IsTest(testFor=...) for the specified targets (can be specified multiple times)
  -h, --help                        help for test
      --integration-tests           run @IntegrationTest tests (commit semantics with @TearDown) instead of @IsTest/testMethod tests; with --watch, committed data persists across iterations like a scratch org, so rely on @TearDown for cleanup
      --json string[="-"]           write test results as JSONL (use --json or --json=FILE)
      --junit string                write JUnit XML test results to file
      --locale string               default locale for test users (e.g., en_US, en_GB, de_DE)
      --no-flow-conversion          disable converting record-triggered flows to generated Apex
      --package strings             package files to load (can be specified multiple times)
      --package-dir strings         directories containing .pkg files to load (can be specified multiple times)
      --profile file[="-"]          write Apex profiling data to file (use --profile without a file to open in Perfetto)
  -q, --quiet                       only output failures and summary
      --read-only                   run tests with application read-only mode (disables DML operations)
      --role string                 role for the default test user; created if it does not exist
      --runs int                    run each selected test method this many times (useful for identifying flaky tests) (default 1)
      --sandbox                     set Organization.IsSandbox to true
      --skip strings                exclude tests by name (substring match, applied after filter, can be specified multiple times)
      --skip-errors                 display but skip parse, type checking, and metadata dependency errors, allowing tests to run if they don't depend on the invalid files or metadata
      --skip-mixed-dml-validation   do not enforce MIXED_DML_OPERATION, as Salesforce skips the check for tests run during a deployment or validation
      --spill-to-disk string        switch per-test databases from memory to temporary on-disk files under memory pressure: auto, never, or always (default "auto")
      --suite strings               run the test classes in the named ApexTestSuite (can be specified multiple times)
      --timeout int                 timeout in seconds for each test (0 = no timeout) (default 300)
      --timezone string             default timezone for test users (e.g., America/Los_Angeles, America/Chicago)
      --trace file[="-"]            write Apex execution trace to file (use --trace without a file to open in Perfetto)
      --watch                       watch inputs for changes and re-run specified tests

Options inherited from parent commands

      --help-aerrc      show how the .aerrc configuration file works and exit
  -v, --verbose count   increase verbosity (repeat for more detail)

SEE ALSO

  • aer - aer is the Apex Execution Runtime
© 2012–2026 October Swimmer.