Coder Social home page Coder Social logo

Comments (7)

viniciusavieira avatar viniciusavieira commented on June 29, 2024 1

@coderas sorry for the time without response. I think that actually what @jenniferlynparsons pointed makes a lot of sense, and I noticed that in the last release it is working fine.

It was probably related to the setup I guess.

Thanks for your time!

from babel-plugin-jsx-remove-data-test-id.

coderas avatar coderas commented on June 29, 2024

Hi, this should be down to your build configuration. The plugin doesn't really care about the file extension, so anytime babel is parsing your JSX, it should strip the attributes just fine.

from babel-plugin-jsx-remove-data-test-id.

viniciusavieira avatar viniciusavieira commented on June 29, 2024

Nice, maybe I've got some setup wrong, I've installed the plugin and checked it really stripped off the data-testis(react-testing-library) when I did build the project.
But as I ran than test suite, it broke most of tests by not find this same data-testid elements.
Do I have to setup something different?
I did installed it and add to the plugin list on Babel.rc.

Thanks again.

from babel-plugin-jsx-remove-data-test-id.

coderas avatar coderas commented on June 29, 2024

Do you have some config to look at?

Reopening, closed by accident!

from babel-plugin-jsx-remove-data-test-id.

coderas avatar coderas commented on June 29, 2024

It sounds a lot like you need a different setup for your test environment.

If you post your configs that might help us to take a look.

from babel-plugin-jsx-remove-data-test-id.

jenniferlynparsons avatar jenniferlynparsons commented on June 29, 2024

@viniciusavieira i had the same issue. i resolved it by limiting the plugin to the prod or dev environments only:

{
  env: {
    production: {
      plugins: ["babel-plugin-jsx-remove-data-test-id"]
    },
    test: {
      plugins: ["other-plugins"]
    }
  }
}

from babel-plugin-jsx-remove-data-test-id.

coderas avatar coderas commented on June 29, 2024

No worries, thanks for the thread!

from babel-plugin-jsx-remove-data-test-id.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.