japa.dev icon indicating copy to clipboard operation
japa.dev copied to clipboard

doc(plugins): add help for type error about expect plugin

Open AlexandreGerault opened this issue 2 years ago • 4 comments

When installing japa from the doc instructions, it is not mentioned to include the bin folder, which can lead to a TypeScript error saying expect is not available in TestContext type. Some people who aren't used that much to TypeScript can take a while to figure out what they're missing.

🔗 Linked issue

This is somehow related to issue https://github.com/japa/expect/issues/1

❓ Type of change

  • [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • [X] 📄 Documentation

📚 Description

The point of this PR is just to add a small indication about including the bin folder in the tsconfig to avoid the type error

Property 'expect' does not exist on type 'TestContext'.

📝 Checklist

  • [X] I have linked an issue or discussion.
  • [X] I have updated the documentation accordingly.

AlexandreGerault avatar Jan 20 '24 21:01 AlexandreGerault

Maybe it would be better to also include the exact error message for SEO purpose (when pasting the error right into your search engine)?

Property 'expect' does not exist on type 'TestContext'.

AlexandreGerault avatar Jan 20 '24 21:01 AlexandreGerault