You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the use of supertest with a non-trivial Express application setup using expresso-ts and InversifyJS for dependency injection, we face a challenge on how to integrate supertest for testing HTTP requests without directly exposing our Express application instance (this.app). We want to be cautious about maintaining good encapsulation and architecture practices.
One way to achieve this is by using a dedicated method in your AppExpress class that can be called during testing to get the app instance wrapped properly for testing purposes. This method will not expose this.app directly but instead can return a version of the application that is suitable for testing.
Requirements
Method creation with a wrapper around this.app (expressja app instance)
The text was updated successfully, but these errors were encountered:
Description
With the use of
supertest
with a non-trivial Express application setup usingexpresso-ts
and InversifyJS for dependency injection, we face a challenge on how to integrate supertest for testing HTTP requests without directly exposing our Express application instance(this.app)
. We want to be cautious about maintaining good encapsulation and architecture practices.One way to achieve this is by using a dedicated method in your AppExpress class that can be called during testing to get the app instance wrapped properly for testing purposes. This method will not expose this.app directly but instead can return a version of the application that is suitable for testing.
Requirements
this.app
(expressja app instance)The text was updated successfully, but these errors were encountered: