NYCPlanning / deprecated-labs-zap-api

Deprecated version of the ZAP API, see https://github.com/NYCPlanning/labs-zap-api
Other
5 stars 3 forks source link

Rework test suite using refreshable stubs; #151

Closed allthesignals closed 5 years ago

allthesignals commented 5 years ago

First pass at surface-level API tests using stubbed CRM response fixtures.

Some ESLint checks currently fail because of needed refactoring.

allthesignals commented 5 years ago

We can still stub the Project resource using refreshable stubs, but we should adopt a more mature approach to testing Postgres-backed ProjectFragments by setting up a test database environment: https://github.com/vitaly-t/pg-promise/blob/master/.travis.yml#L14

allthesignals commented 5 years ago

This approach also allows us to just stub the database connection but would require more sophistication in terms of wrapping up all the interactions with the database instance into separate modules: https://stackoverflow.com/a/37378243