Record, Replay, and Stub HTTP Interactions.
Interested in contributing or just seeing Polly in action? Head over to CONTRIBUTING.md to learn how to spin up the project!
Keeping fixtures and factories in parity with your APIs can be a time consuming process. Polly alleviates this process by recording and maintaining actual server responses while also staying flexible.
Check out the Quick Start documentation to get started.
Let's take a look at what an example test case would look like using Polly.
…The above test case would generate the following HAR file which Polly will use to replay the sign-in response when the test is rerun:
…The "Client Server" API of Polly is heavily influenced by the very popular mock server library pretender. Pretender supports XHR and Fetch stubbing and is a great lightweight alternative to Polly if your project does not require persisting capabilities or Node adapters.
Thank you to all contributors especially the maintainers: trek, stefanpenner, and xg-wang.
Copyright (c) 2018 Netflix, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Path Traversal Leading to Arbitrary File Write
Cannot use with typescript: Adapter is not assignable to parameter of type Newable<any>
Can polly record and replay websockets requests?
Issue attaching to puppeteer. Emitter undefined.
PollyError: [Polly] Request failed due to an unknown error. TIMEOUT
Need to regenerate records if `matchRequestsBy` changes
NodeHttpAdapter's use of the non-standard options.href causes different behavior when Polly is enabled
[feature] - Vitest support
[Bug] Polly replays weird array type from persisted file (replayedData instanceof Array returns false)
[Question] What is the purpose of the number on the end of the directory names?