plugins/TestRunner/README.vue.md
tests:run-vueRun Vue component unit tests.
ddev matomo:console tests:run-vue [specs...] [--plugin=<Plugin>] [--run-in-band] [--verbose]
specs
--plugin is provided.--plugin
CoreHome or plugins/CoreHome style values.plugins/, it is normalized to plugins/<Name>.MATOMO_CURRENT_PLUGIN for the npm test process.plugins/<Name>/vue/**/*.spec.[tj]s.--run-in-band
--runInBand to run tests serially.--verbose
--verbose for detailed test output.npm test and appends translated test path filters when needed.Run all Vue tests:
ddev matomo:console tests:run-vue
Run one spec by full path:
ddev matomo:console tests:run-vue plugins/CoreHome/vue/src/Alert/Alert.spec.ts
Run one spec by name fragment:
ddev matomo:console tests:run-vue Alert.spec.ts
Run tests for a specific plugin:
ddev matomo:console tests:run-vue --plugin=CoreHome
Run serially with verbose output:
ddev matomo:console tests:run-vue --run-in-band --verbose
Run with multiple spec arguments:
ddev matomo:console tests:run-vue Alert.spec.ts Notification.spec.ts
--plugin=CoreHome or --plugin=plugins/CoreHome.--verbose for detailed output.--run-in-band to run tests serially when debugging flaky tests.For command help:
ddev matomo:console tests:run-vue --help
plugins/<PluginName>/vue/src/MyComponent/MyComponent.spec.ts
import { mount } from '@vue/test-utils';
import MyComponent from './MyComponent.vue';
describe('<PluginName>/MyComponent', () => {
it('renders', () => {
const wrapper = mount(MyComponent);
expect(wrapper.exists()).toBe(true);
});
});
ddev matomo:console tests:run-vue MyComponent.spec.ts
or
ddev matomo:console tests:run-vue --plugin=MyPlugin