If there's a way to apply this change to the original PR, please point me toward it and I'll do it.
This PR includes the changes @NikitaFedorov1 made for PR 335. My understanding of his comment in 335 is that he does not intend to apply the test changes requested. I just changed a few lines in his tests (commit #5) so others can get the benefit of this fix.
I broke the tests several times before getting them right, so I know they can fail. :smile: Also confirmed response bodies/error details matched those from the hard coded tokens while working on the tests.
Generates JWTs dynamically in tests as requested by @mcollina on https://github.com/fastify/fastify-jwt/pull/335.
If there's a way to apply this change to the original PR, please point me toward it and I'll do it.
This PR includes the changes @NikitaFedorov1 made for PR 335. My understanding of his comment in 335 is that he does not intend to apply the test changes requested. I just changed a few lines in his tests (commit #5) so others can get the benefit of this fix.
I broke the tests several times before getting them right, so I know they can fail. :smile: Also confirmed response bodies/error details matched those from the hard coded tokens while working on the tests.
PR 335 description
False positive tests: test: Async key provider errors should be resolved internally
Fix & test fix: feat: Async key provider
Related issue: https://github.com/fastify/fastify-jwt/issues/334
Checklist
npm run test
andnpm run benchmark