Apply suggestions from code review of branch webapp_unit_testing Co-authored-by: @beth_probert

This commit is contained in:
Antonio Anaya 2026-05-19 09:51:18 -06:00
parent 656afd30d2
commit bf6dcebc16
3 changed files with 8 additions and 2 deletions

View file

@ -30,13 +30,18 @@ export default defineConfig(({ command, mode }) => {
return {
plugins: [
vue({
// Block for removing data-test-id tags on npm run build
// Strip "data-test-id" attributes (used by Vitest) from the production build.
// This enforces separation of concerns and prevents developers from relying on
// test IDs for styling or core application logic.
template: {
compilerOptions: {
// Only apply this AST transformation during production builds
nodeTransforms: isProduction
? [
(node) => {
// Check if the current AST node is an HTML element
if (node.type === 1 /* NodeTypes.ELEMENT */) {
// Filter out any property named "data-test-id"
node.props = node.props.filter((prop) => prop.name !== "data-test-id");
}
},

View file

@ -39,7 +39,7 @@ export default defineConfig({
clean: true,
cleanOnStart: true,
// text gives output on STOUT and html creates an artifact
reporter: ["text", "html"],
reporter: ["text", "html", "cobertura"],
all: true,
// Files to include or exclude in coverage
include: ["src/**/*.vue", "src/**/*.js"],