Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swashcap/pollyjs-multipart-form-data-error
A example demonstrating a multipart/form-data error with Polly.JS
https://github.com/swashcap/pollyjs-multipart-form-data-error
Last synced: 5 days ago
JSON representation
A example demonstrating a multipart/form-data error with Polly.JS
- Host: GitHub
- URL: https://github.com/swashcap/pollyjs-multipart-form-data-error
- Owner: swashcap
- License: apache-2.0
- Created: 2019-09-17T03:27:42.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T10:32:35.000Z (almost 2 years ago)
- Last Synced: 2023-04-01T03:29:01.147Z (over 1 year ago)
- Language: JavaScript
- Size: 718 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pollyjs-multipart-form-data-error
A example demonstrating a multipart/form-data error with Polly.JS
## Setup
Ensure [Node.js](https://nodejs.org/en/) `>= 10.x.x` and
[yarn](https://yarnpkg.com/lang/en/) are installed.1. Clone the project
2. Install the dependencies:```shell
yarn
```## Running
Run the tests with yarn:
```shell
yarn test
```## Output
The tests currently fail:
```shell
$ yarn --silent test
FAIL src/upload.spec.js
multipart/form-data request
✕ should upload a file (132ms)● multipart/form-data request › should upload a file
StatusCodeError: 400 - ""
at new StatusCodeError (node_modules/request-promise-core/lib/errors.js:32:15)
at Request.plumbing.callback (node_modules/request-promise-core/lib/plumbing.js:104:33)
at Request.RP$callback [as _callback] (node_modules/request-promise-core/lib/plumbing.js:46:31)
at Request.self.callback (node_modules/request/request.js:185:22)
at Request. (node_modules/request/request.js:1161:10)
at IncomingMessage. (node_modules/request/request.js:1083:12)● multipart/form-data request › should upload a file
PollyError: [Polly] [persister:fs] Cannot persist response for [POST] http://localhost:3001/upload because the status code was 400 and `recordFailedRequests` is `false`
at Object.assert (node_modules/@pollyjs/utils/src/utils/assert.js:5:11)
at FSPersister.assert (node_modules/@pollyjs/persister/src/index.js:175:5)
at FSPersister.assert [as persist] (node_modules/@pollyjs/persister/src/index.js:73:14)Test Suites: 1 failed, 1 total
Tests: 1 failed, 1 total
Snapshots: 0 total
Time: 1.009s, estimated 2s
Ran all test suites.
error Command failed with exit code 1.
```