Giter VIP home page Giter VIP logo

Comments (3)

Brooooooklyn avatar Brooooooklyn commented on June 12, 2024

I guess you have a jsx file with .js file extension. @swc-node/jest detect the jsx option by the file extension. But you could always enable jsx but lost some speed:

transform: {
  "^.+\\.(js|jsx|ts|tsx)$": ["@swc-node/jest", { jsx: true }],
}
```

from swc-node.

pkawula avatar pkawula commented on June 12, 2024

Thats an idea, then something changes and I have another error:

 FAIL  src/components/__tests__/Message.test.tsx
  ● Test suite failed to run

    TypeError: Cannot set property render of [object Object] which has only a getter

      25 | export * from "@testing-library/react";
      26 |
    > 27 | export { customRender as render };
         |                                ^
      28 |

      at Object.<anonymous> (src/helpers/tests.tsx:27:32)
      at Object.<anonymous> (src/components/__tests__/Message.test.tsx:4:41)
  I think it can be related to similar for babel [https://stackoverflow.com/a/53307822/9094066](https://stackoverflow.com/a/53307822/9094066)
  Problem might be the  same, because I reexport  a providers for an App:
     const Providers = ({ children }) => (
   <Provider store={store}>
   	<EventProvider observers={[Gtag, PostAffiliatePro]}>
   		<ProductsListContextProvider>{children}</ProductsListContextProvider>
   	</EventProvider>
   </Provider>
);

const customRender = (
   ui: ReactElement<any, string | JSXElementConstructor<any>>,
   options: RenderOptions = {}
) => render(ui, { wrapper: Providers, ...options });

export * from "@testing-library/react";

export { customRender as render };

from swc-node.

pkawula avatar pkawula commented on June 12, 2024

I am closing this, because it is working now

from swc-node.

Related Issues (20)

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.