nuxt / nuxt/test-utils

Removing data-test attributes in build

Open
#1,738 9 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

workaround available
Dominant language
TypeScript
Stars
437
Forks
120
Avg merge
22h 52m
Merged PRs (30d)
23

Description

Testing is really important and in my Nuxt3 playground project it works great apart from I had to manually provide components on mount that normally are auto-imported.

It's common way to add data-test or data-testid or any other simmilar attribute to elements we wanna test. And It'd be great if nuxt will have feature to automatically remove data-test attributes from the production build.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reproducing the behavior in the Nuxt3 playground described in the issue and inspect the production build path; the work is done when the agreed data-test-style attributes are removed from production output without disrupting test builds or component auto-imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxtjs, typescript
Domain
build-system, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.