A small JavaScript project to practice Cursor’s AI features.
You’ll fix broken tests using:
- Inline Edit (⌘ + K)
- Chat With Codebase (⌘ + L)
- Composer (⌘ + I)
-
Node.js and npm:
-
Using Homebrew (recommended):
brew install node
-
Or download the macOS installer (.pkg) from nodejs.org
-
Verify installation in Terminal:
node --version npm --version
-
-
A code editor with Cursor installed (the AI-integrated IDE).
- Clone this repository into a folder on your machine.
- Open the folder with Cursor.
- Run
npm install
to install dependencies.
npm test
Scenario: The code returns 10 for any input, but the test expects dynamic calculation.
- File: ./src/main.js
- Test: ./test/main.test.js
Scenario: The function works but is messy. Using the Chat, ask cursor to explain the code and then refactor it.
- Files:
- Test: ./test/composerUsage.test.js
Scenario: The test imports a function named multiply, but the code still calls it multiplyComposerNumbers.
- Use Inline Edit + Chat together: Combine AI features for better results
- Add context by including multiple files in your prompts
- When stuck, include the entire codebase in your prompt for better AI understanding
- Run
npm test
frequently to catch any unintended side effects - Review AI suggestions carefully before applying them
- Don’t forget to commit your changes to track progress.
Happy coding with Cursor!