kentcdodds / testing-react-apps

A workshop for testing react applications
https://www.epicreact.dev/modules/testing-react-apps-v1/testing-react-apps-welcome
Other
1.07k stars 719 forks source link

JS file extension references in markdown instructions #69

Closed Aprillion closed 2 years ago

Aprillion commented 2 years ago

Working with instructions in the next TS branch, I notice a few places in 05.md, 06.md, and 07.md which mention JS file extensions: search for \.js\b

The test/server-handlers.js mentioned in 05.md extra credit 1 is an instruction for importing - to my surprise the import works even with .js extension even though only .ts file exists in that directory 🤷‍♂️ so maybe no action needed, up to you.

Aprillion commented 2 years ago

Actually, VS Code pretends that the .js file can be imported and click-through works, but Jest itself does not have any black magic to resolve .js file extension when only a .ts file exists => the files should be either called .ts in the next branch or we could use another import black magic and don't use any file extension (in which case the same .md files can be used in both main and next branches).

kentcdodds commented 2 years ago

Thanks! I'd prefer to just use .ts in the next branch. Updated 👍