Skip to content

Commit

Permalink
test: skip node < 18
Browse files Browse the repository at this point in the history
  • Loading branch information
climba03003 committed Apr 5, 2024
1 parent 137450b commit ec57816
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"standard": "^17.0.0",
"tap": "^16.0.0",
"tinybench": "^2.5.1",
"tsd": "^0.31.0",
"undici": "^5.28.4"
"tsd": "^0.31.0"
},
"scripts": {
"benchmark": "node benchmark/benchmark.js",
Expand Down
8 changes: 6 additions & 2 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ const qs = require('node:querystring')
const fs = require('node:fs')
const zlib = require('node:zlib')
const http = require('node:http')
const { Blob } = require('node:buffer')
const eos = require('end-of-stream')
const express = require('express')

const inject = require('../index')
const parseURL = require('../lib/parse-url')

const { FormData } = require('undici')
const NpmFormData = require('form-data')
const formAutoContent = require('form-auto-content')
const httpMethods = [
Expand Down Expand Up @@ -2016,6 +2014,12 @@ test('request that is destroyed does not error', (t) => {
})

test('undici / native form-data should be handled correctly', (t) => {
if (parseInt(process.versions.node.split('.', 1)[0], 10) < 18) {
t.pass('Skip because Node version < 18 do not provide FetchAPI')
t.end()
return
}

t.plan(23)

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

0 comments on commit ec57816

Please sign in to comment.