The official introduction React Testing Library | Testing Library links to a tutorial page React Testing Library Tutorial. In the tutorial it says "After running your test on the command line, you should see the HTML output of your App component". First of all, what tf does this the command
mean?? I thought, but anyways I tried npx jest
, got an error as the title, the detailed error as the below:
FAIL src/App.test.js
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
I guess the tutorial is for create-react-app users maybe, but I don't use it and I'm on Webpack. Even if I needed to do something to get the thing working, I have no clue what I need to do on my package.json/.babelrc/webpack.config.js etc, because the intro/tutorial didn't clarify it.
So, 1. What can I do to make the thing working? 2. Is there a decent official/non-official step by step doc/tutorial?; Thanks.