-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Server level configuration #80
Conversation
I'm worried It's unclear when one would use the request-level configuration over the server/route level. Should we simplify and only support one for now until there is a clear use-case? |
].forEach(key => | ||
expect(() => server.any().configure({ [key]: 'foo' })).to.throw( | ||
Error, | ||
/Invalid configuration option/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error could include these options not being allowed to be configure through the new config API vs invalid configuration options since they're technically valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire error message is:
`Invalid configuration option provided. The "${key}" option cannot be overridden.`
Do you have anything else in mind?
@@ -3,7 +3,7 @@ import Timing from '../../../src/utils/timing'; | |||
function fixedTest(ms) { | |||
it(`should handle ${ms}ms`, async function() { | |||
// Fail the test if it exceeds ms + 10ms buffer | |||
this.timeout(ms + 10); | |||
this.timeout(ms + 50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Proposed Changes
intercept
Intercept can now be registered on the middleware level. If multiple intercept handlers have been
registered, each handler will be called in the order in which it was registered.
Example
passthrough
Passthrough can now be registered on the middleware level. It also now accepts a boolean which allows the user to explicitly enable or disable it.
boolean
true
Example
recordingName new
Override the recording name for the given route. This allows for grouping common
requests to share a single recording which can drastically help de-clutter test
recordings.
For example, if your tests always make a
/users
or/session
call, instead ofhaving each of those requests be recorded for every single test, you can use
this to create a common recording file for them.
String
Example
configure new
Override configuration options for the given route. All matching middleware and route level configs are merged together and the overrides are applied to the current
Polly instance's config.
Object
Example