Skip to content

Add Nock Integration Tests for One API Example #1406

@YasharF

Description

@YasharF

Update Oct 22: As we are approaching the end of October, I'll accept the first PR that is ready to be merged. No need for an exclusive issue assignment. Note that AI generated content including code, PR description, or issue reply text may be marked as SPAM.


We need to introduce Nock for backend integration testing. The goal is to stub outbound HTTP calls in one of the API example controllers (e.g., Foursquare, GitHub, Twitter, etc.) and verify that our backend logic handles responses correctly.

This first integration test should:

  • Use Mocha/Chai/Sinon as the test runner/assertion framework.
  • Use Nock to intercept one API endpoint and return a canned response.
  • Assert that the controller/service processes the mocked response as expected.

Acceptance Criteria:

  • Nock is installed and configured for use in integration tests.
  • A test file exists under test/integration/ that covers one API example controller.
  • The test runs without network access (all external calls are mocked).
  • The README Testing section is updated with instructions on:
    • How to run integration tests (npm run test:unit or similar).
    • How to add new Nock tests for additional API integrations.
    • Recap: Integration tests should validate backend logic in isolation, using Nock to simulate external APIs. Contributors can extend coverage by following the provided example.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions