@@ -26,7 +26,6 @@ import process from "process"
26
26
import os from "os"
27
27
import cpy from "cpy"
28
28
import { dir as getTmpDir } from "tmp-promise"
29
- import { downloadFile } from "../packages/runtime/src/templates/handlerUtils"
30
29
import { getExtendedApiRouteConfigs } from "../packages/runtime/src/helpers/functions"
31
30
// @ts -expect-error - TODO: Convert runtime export to ES6
32
31
import nextRuntimeFactory from "../packages/runtime/src"
@@ -1087,38 +1086,6 @@ describe('onPostBuild', () => {
1087
1086
} )
1088
1087
1089
1088
describe ( 'function helpers' , ( ) => {
1090
- it ( 'downloadFile can download a file' , async ( ) => {
1091
- const url =
1092
- 'https://raw.githubusercontent.com/netlify/next-runtime/c2668af24a78eb69b33222913f44c1900a3bce23/manifest.yml'
1093
- const tmpFile = join ( os . tmpdir ( ) , 'next-test' , 'downloadfile.txt' )
1094
- await ensureDir ( path . dirname ( tmpFile ) )
1095
- await downloadFile ( url , tmpFile )
1096
- expect ( existsSync ( tmpFile ) ) . toBeTruthy ( )
1097
- expect ( readFileSync ( tmpFile , 'utf8' ) ) . toMatchInlineSnapshot ( `
1098
- "name: netlify-plugin-nextjs-experimental
1099
- "
1100
- ` )
1101
- await unlink ( tmpFile )
1102
- } )
1103
-
1104
- it ( 'downloadFile throws on bad domain' , async ( ) => {
1105
- const url = 'https://nonexistentdomain.example'
1106
- const tmpFile = join ( os . tmpdir ( ) , 'next-test' , 'downloadfile.txt' )
1107
- await ensureDir ( path . dirname ( tmpFile ) )
1108
- await expect ( downloadFile ( url , tmpFile ) ) . rejects . toThrowErrorMatchingInlineSnapshot (
1109
- `"getaddrinfo ENOTFOUND nonexistentdomain.example"` ,
1110
- )
1111
- } )
1112
-
1113
- it ( 'downloadFile throws on 404' , async ( ) => {
1114
- const url = 'https://example.com/nonexistentfile'
1115
- const tmpFile = join ( os . tmpdir ( ) , 'next-test' , 'downloadfile.txt' )
1116
- await ensureDir ( path . dirname ( tmpFile ) )
1117
- await expect ( downloadFile ( url , tmpFile ) ) . rejects . toThrowError (
1118
- 'Failed to download https://example.com/nonexistentfile: 404 Not Found' ,
1119
- )
1120
- } )
1121
-
1122
1089
describe ( 'config' , ( ) => {
1123
1090
describe ( 'dependency tracing' , ( ) => {
1124
1091
it ( 'extracts a list of all dependencies' , async ( ) => {
0 commit comments