Skip to content

Commit 02356b6

Browse files
committed
test: fixing broken multipart tests
1 parent b3268ef commit 02356b6

31 files changed

+153
-145
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ HTTPSnippet.prototype.prepare = function (request) {
122122
// This hack is pretty awful but it's the only way we can use this library in the browser as if we code this
123123
// against just the native FormData object, we can't polyfill that back into Node because Blob and File objects,
124124
// which something like `formdata-polyfill` requires, don't exist there.
125-
const isNativeFormData = (typeof form[Symbol.iterator] === 'function');
125+
const isNativeFormData = (typeof form[Symbol.iterator] === 'function')
126126

127127
// easter egg
128128
const boundary = '---011000010111000001101001'
129129
if (!isNativeFormData) {
130-
form._boundary = boundary;
130+
form._boundary = boundary
131131
}
132132

133133
request.postData.params.forEach(function (param) {
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
POST /har HTTP/1.1
2-
Content-Type: application/x-www-form-urlencoded
3-
Host: mockbin.com
4-
Content-Length: 19
5-
1+
POST /har HTTP/1.1
2+
Content-Type: application/x-www-form-urlencoded
3+
Host: mockbin.com
4+
Content-Length: 19
5+
66
foo=bar&hello=world
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
POST /har HTTP/1.1
2-
Content-Type: application/json
3-
Host: mockbin.com
4-
Content-Length: 118
5-
1+
POST /har HTTP/1.1
2+
Content-Type: application/json
3+
Host: mockbin.com
4+
Content-Length: 118
5+
66
{"number":1,"string":"f\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":{}}],"boolean":false}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
POST /har HTTP/1.1
2-
Cookie: foo=bar; bar=baz
3-
Host: mockbin.com
4-
1+
POST /har HTTP/1.1
2+
Cookie: foo=bar; bar=baz
3+
Host: mockbin.com
4+
55

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PROPFIND /har HTTP/1.1
2-
Host: mockbin.com
3-
1+
PROPFIND /har HTTP/1.1
2+
Host: mockbin.com
3+
44

test/fixtures/output/http/1.1/full

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
POST /har?foo=bar&foo=baz&baz=abc&key=value HTTP/1.1
2-
Cookie: foo=bar; bar=baz
3-
Accept: application/json
4-
Content-Type: application/x-www-form-urlencoded
5-
Host: mockbin.com
6-
Content-Length: 7
7-
1+
POST /har?foo=bar&foo=baz&baz=abc&key=value HTTP/1.1
2+
Cookie: foo=bar; bar=baz
3+
Accept: application/json
4+
Content-Type: application/x-www-form-urlencoded
5+
Host: mockbin.com
6+
Content-Length: 7
7+
88
foo=bar
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
GET /har HTTP/1.1
2-
Accept: application/json
3-
X-Foo: Bar
4-
Host: mockbin.com
5-
1+
GET /har HTTP/1.1
2+
Accept: application/json
3+
X-Foo: Bar
4+
Host: mockbin.com
5+
66

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GET /har HTTP/1.1
2-
Host: mockbin.com
3-
1+
GET /har HTTP/1.1
2+
Host: mockbin.com
3+
44

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
POST /har HTTP/1.1
2-
Content-Type: application/json
3-
Host: mockbin.com
4-
Content-Length: 18
5-
1+
POST /har HTTP/1.1
2+
Content-Type: application/json
3+
Host: mockbin.com
4+
Content-Length: 18
5+
66
{
77
"foo": "bar"
88
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
POST /har HTTP/1.1
2-
Content-Type: application/json
3-
Host: mockbin.com
4-
Content-Length: 12
5-
1+
POST /har HTTP/1.1
2+
Content-Type: application/json
3+
Host: mockbin.com
4+
Content-Length: 12
5+
66
{"foo":null}

0 commit comments

Comments
 (0)