This project contains a TokenManager class that handles authentication token lifecycle, including automatic refresh when tokens expire. However, there are several bugs causing test failures.
To run this test you will require the following installed on your machine:
Attempt to get the tests green/passing. There is also a memory leak bug that isn't captured by the tests if you can spot it. But the most valuable aspect is documenting in the JOURNAL.md as described below.
You MUST use JOURNAL.md to document:
- Each issue/bug you identify
- Why you're making each change
- Your reasoning and approach
- Any code snippets you think are relevant
Make a journal entry for each commit. This is a critical part of the assessment.
src/TokenManager.ts- Token management class (has bugs - fix this!)src/mockApi.ts- Mock Firebase API (don't modify)__tests__/TokenManager.test.ts- Test suite (don't modify)
# Install dependencies
npm install
# Run tests in watch mode (tests auto-rerun when you save changes)
npm run test:watch
# or not in watch mode
npm test- Attempt to get tests passing
- Ensure
JOURNAL.mdhas notes for each commit - Submit your solution
Good luck! 🚀