Skip to content

Create Vue Test ​

Generate a Vitest test stub for a Vue component or feature.

Command Information ​

  • Signature: modularous:make:vue:test [name?] [type?] [--importDir] [--F|force]
  • Aliases: modularous:create:vue:test, mod:c:vue:test
  • Category: Generators

Arguments ​

ArgumentRequiredDescription
nameNoTest name (StudlyCase). Prompted interactively if omitted
typeNoTest type (e.g. component, composable). Prompted via select if omitted

Options ​

OptionDescription
--importDirSet a subfolder used as the import base path in the generated test
--force / -FOverwrite the test file if it already exists

What It Does ​

Delegates to VueTestGenerator, which resolves the test type and writes a Vitest stub. Available types are determined by the generator's getTypes() method. If name or type are not provided the command prompts interactively.

Examples ​

bash
# Fully interactive
php artisan modularous:make:vue:test

# Provide all arguments
php artisan modularous:make:vue:test ProductCard component

# Force overwrite
php artisan modularous:make:vue:test ProductCard component --force