bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
797 stars 187 forks source link

Refactored tests! #104

Closed rosston closed 8 years ago

rosston commented 8 years ago

(Hopefully) fixes #60.

Simplify the setup code used to create mock requests. Remove all shared state across tests. Convert mock requests to return promises for easy asynchronous testing. There should be no need now to use before or beforeEach blocks...

...which makes this possible: Moved describe and it blocks around so that it should be clearer 1) what tests go where, and 2) what is being tested.

I think there are still some holes in the test suite, but I think this new setup should make it easier to find and fix them.

For the sake of reviewers (@bithavoc and @floatingLomas), I thought it would be nicer to have the commits separated. I'll squash before merge/whenever if someone wants it squashed sooner.

bithavoc commented 8 years ago

:+1: