spotify / polly-jest-presets

Apache License 2.0
64 stars 10 forks source link

Make expiryStrategy consistent across local & CI environments #11

Open sankaritan opened 4 years ago

sankaritan commented 4 years ago

Starting to questioning this as a default setup: https://github.com/spotify/polly-jest-presets/blob/master/src/index.ts#L27

Multiple projects using the preset required certain configuration changes depending on the POLLY_MODE. An example would be reducing timeouts during the reply mode of spinning up additional proxies for the record mode.

When POLLY_MODE is set to replay & expiryStrategy to record, this can cause test being re-recorded while running on the incorrect configuration. Had to override the expiryStrategy in the local config to always be set to record to mitigate this now.

It would be worth looking at other projects using the preset & potentially removing the ternary from the default config to always default to error. We have learned in our initial testing, after all, that any discrepancy between the local setup and the setup that runs on CI can be very confusing to the developer.

@palmerj3 @fastfrwrd @agraves