Skip to content

LSIF: Replace integration tests with unit tests

Warren Gifford requested to merge lsif-backend-tests into master

Created by: efritz

Refactoring steps taken:

  • Move the cache instances from the backend to static properties of the database.
  • Replace createDatabase instance function of Backend with a function (optionally) supplied in the constructor.
  • Move functions unused by the database out of database.ts.
  • Simplify some conditions in the backend.
  • Remove all integration tests.
  • Move non-integration tests (but db-interfacing tests) next to the code they test.
  • Add unit tests for backend and database.

This will make it possible to retain the same test functionality after splitting the backend and the database classes into different services.

Note to reviewers: These tests are not perfect (no code is), but it's going to unblock us from progressing on RFC 127, and the tests may need to change a great deal once we've refactored into services. Do not look too carefully at the test implementations, which are still a good incremental upgrade from the previous state.

Merge request reports

Loading