Skip to content

Instantly share code, notes, and snippets.

@manavm1990
Created October 21, 2025 00:01
Show Gist options
  • Select an option

  • Save manavm1990/97547ff92330c15f07686ec57783fe99 to your computer and use it in GitHub Desktop.

Select an option

Save manavm1990/97547ff92330c15f07686ec57783fe99 to your computer and use it in GitHub Desktop.

Ticket #1: Complete Filter Tests

Assigned to: Groups 1 & 2
Estimated time: 15-20 minutes
Difficulty: ⭐ Easy

What You're Doing

The filterByType function works perfectly, but it only has ONE test. Add more tests to make sure it handles all cases.

Tasks

  1. ✅ Read the existing test for fire type
  2. ➕ Add test: "should return only water type Pokemon"
  3. ➕ Add test: "should return empty array when type doesn't exist"
  4. ➕ Add test: "should return multiple Pokemon of same type"

Test Data to Use

// Use the testPokemon array that's already in the file
// Or create your own mini test array if needed

Example Test

test('should return only water type Pokemon', () => {
  const result = filterByType(testPokemon, 'water');
  expect(result.length).toBe(1);
  expect(result[0].name).toBe('Squirtle');
});

Git Workflow

# Create branch
git checkout -b ticket-1-filter-tests

# After each test you write
git add src/__tests__/pokemon-utils.test.js
git commit -m "test: add water type filter test"

# Continue for each test...
git commit -m "test: add edge case for non-existent type"
git commit -m "test: add multiple Pokemon same type test"

# Push and create PR
git push origin ticket-1-filter-tests

Success Criteria

  • At least 3 new tests added
  • All tests pass (npm test)
  • Meaningful commit messages
  • Can explain what each test checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment