1
1
import { readFile } from 'fs/promises'
2
2
import { join , resolve } from 'path'
3
- import { platform , version as nodeVersion } from 'process'
4
- import { promisify } from 'util'
3
+ import { platform } from 'process'
5
4
6
5
import { getPath as getBootstrapPath } from '@netlify/serverless-functions-api'
7
6
import merge from 'deepmerge'
8
- import glob from 'glob'
7
+ import { glob } from 'glob'
9
8
import { pathExists } from 'path-exists'
10
- import semver from 'semver'
11
9
import { dir as getTmpDir } from 'tmp-promise'
12
10
import { afterEach , describe , expect , test , vi } from 'vitest'
13
11
@@ -18,11 +16,9 @@ import { invokeLambda, readAsBuffer } from './helpers/lambda.js'
18
16
import { zipFixture , unzipFiles , importFunctionFile , FIXTURES_ESM_DIR , FIXTURES_DIR } from './helpers/main.js'
19
17
import { testMany } from './helpers/test_many.js'
20
18
21
- const pGlob = promisify ( glob )
22
-
23
19
vi . mock ( '../src/utils/shell.js' , ( ) => ( { shellUtils : { runCommand : vi . fn ( ) } } ) )
24
20
25
- describe . runIf ( semver . gte ( nodeVersion , '18.13.0' ) ) ( 'V2 functions API' , ( ) => {
21
+ describe ( 'V2 functions API' , ( ) => {
26
22
afterEach ( ( ) => {
27
23
vi . resetAllMocks ( )
28
24
} )
@@ -132,7 +128,7 @@ describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => {
132
128
133
129
const [ { name : archive , entryFilename, path } ] = files
134
130
135
- const untranspiledFiles = await pGlob ( `${ path } /**/*.ts` )
131
+ const untranspiledFiles = await glob ( `${ path } /**/*.ts` )
136
132
expect ( untranspiledFiles ) . toEqual ( [ ] )
137
133
138
134
const func = await importFunctionFile ( `${ tmpDir } /${ archive } /${ entryFilename } ` )
0 commit comments