Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Apr 8, 2024
1 parent e0406d9 commit c0b269e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/form-data.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

// TODO: remove coverage ignore when node >= 16
/* istanbul ignore file */
const { randomUUID } = require('node:crypto')
const { Readable } = require('node:stream')

Expand Down
2 changes: 2 additions & 0 deletions lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ function Request (options) {
let payload = options.payload || options.body || null
let payloadResume = payload && typeof payload.resume === 'function'

// TODO: remove coverage ignore when node >= 16
/* istanbul ignore if */
if (isFormDataLike(payload)) {
const stream = formDataToStream(payload)
payload = stream.stream
Expand Down
4 changes: 4 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2106,6 +2106,10 @@ test('undici form-data should be handled correctly', (t) => {
const { FormData } = require('undici')
const { Blob } = require('node:buffer')

if (FormData == null) {
return t.skip('`undici` does not expose `FormData` in `node@14`')
}

t.plan(23)

const dispatch = function (req, res) {
Expand Down

0 comments on commit c0b269e

Please sign in to comment.