Skip to content

Commit 3242f9b

Browse files
committed
chore: use fast-glob in v2api.test.ts
1 parent 6c26ffb commit 3242f9b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { readFile } from 'fs/promises'
22
import { join, resolve } from 'path'
3-
import { platform, version as nodeVersion } from 'process'
4-
import { promisify } from 'util'
3+
import { platform } from 'process'
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 'glob'
98
import { pathExists } from 'path-exists'
10-
import semver from 'semver'
119
import { dir as getTmpDir } from 'tmp-promise'
1210
import { afterEach, describe, expect, test, vi } from 'vitest'
1311

@@ -18,11 +16,9 @@ import { invokeLambda, readAsBuffer } from './helpers/lambda.js'
1816
import { zipFixture, unzipFiles, importFunctionFile, FIXTURES_ESM_DIR, FIXTURES_DIR } from './helpers/main.js'
1917
import { testMany } from './helpers/test_many.js'
2018

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

25-
describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => {
21+
describe('V2 functions API', () => {
2622
afterEach(() => {
2723
vi.resetAllMocks()
2824
})
@@ -132,7 +128,7 @@ describe.runIf(semver.gte(nodeVersion, '18.13.0'))('V2 functions API', () => {
132128

133129
const [{ name: archive, entryFilename, path }] = files
134130

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

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

0 commit comments

Comments
 (0)