reduxjs/redux

Redux Testing renderWithProviders function Error

SteveBirkner opened this issue · 4 comments

I am trying to follow the set up guide for testing redux and am running into an issue with the test utils file. The function renderWithProviders is throwing an error for me that looks like:
Screen Shot 2023-02-17 at 8 46 15 AM

Not really sure what is going on here.

@SteveBirkner : that looks like your project may not be set up to transpile the JSX syntax correctly?

@markerikson I am not sure that is it. we have a fully working react app. None of the other components act like this. Unless I am misunderstanding. Is there anything I would have to add to the jest config. Also we are using typescript here. Not sure how much that matters.

@SteveBirkner : it's a syntax error, not a runtime error. So, it's not anything to do with Redux or React-Redux in and of themselves - it's a build setup issue.

I don't know how you've got your test setup configured, but yes, it would be some combination of Jest and TS config to ensure that the JSX is getting transpiled correctly here.

the issue was from naming the file wrong. I stupidly made it a ts file instead of tsx.