Skip to content

Commit ce0f5b3

Browse files
committed
chore: use fast-glob in v2api.test.ts
We have multiple glob dependencies here. This removes one of the last uses of `glob`.
1 parent 8e40ace commit ce0f5b3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/zip-it-and-ship-it/tests/v2api.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { readFile } from 'fs/promises'
22
import { join, resolve } from 'path'
33
import { platform, version as nodeVersion } from 'process'
4-
import { promisify } from 'util'
54

65
import { getPath as getBootstrapPath } from '@netlify/serverless-functions-api'
76
import merge from 'deepmerge'
8-
import glob from 'glob'
7+
import glob from 'fast-glob'
98
import { pathExists } from 'path-exists'
109
import semver from 'semver'
1110
import { dir as getTmpDir } from 'tmp-promise'
@@ -18,8 +17,6 @@ import { invokeLambda, readAsBuffer } from './helpers/lambda.js'
1817
import { zipFixture, unzipFiles, importFunctionFile, FIXTURES_ESM_DIR, FIXTURES_DIR } from './helpers/main.js'
1918
import { testMany } from './helpers/test_many.js'
2019

21-
const pGlob = promisify(glob)
22-
2320
vi.mock('../src/utils/shell.js', () => ({ shellUtils: { runCommand: vi.fn() } }))
2421

2522
describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => {
@@ -132,7 +129,7 @@ describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => {
132129

133130
const [{ name: archive, entryFilename, path }] = files
134131

135-
const untranspiledFiles = await pGlob(`${path}/**/*.ts`)
132+
const untranspiledFiles = await glob(`${path}/**/*.ts`)
136133
expect(untranspiledFiles).toEqual([])
137134

138135
const func = await importFunctionFile(`${tmpDir}/${archive}/${entryFilename}`)

0 commit comments

Comments
 (0)