diff --git a/tests/esbuild.test.ts b/tests/esbuild.test.ts index 83c966640..80028cdc1 100644 --- a/tests/esbuild.test.ts +++ b/tests/esbuild.test.ts @@ -1,6 +1,7 @@ import { build } from '@netlify/esbuild' import { afterEach, describe, expect, test, vi } from 'vitest' +import { ARCHIVE_FORMAT } from '../src/archive.js' import { NODE_BUNDLER } from '../src/runtimes/node/bundlers/types.js' import { zipFixture } from './helpers/main.js' @@ -30,7 +31,10 @@ describe('esbuild', () => { // - in Node <10 we should see `try {} catch (e) {}` // - in Node >= 10 we should see `try {} catch {}` await zipFixture('node-module-optional-catch-binding', { - opts: { archiveFormat: 'none', config: { '*': { nodeBundler: NODE_BUNDLER.ESBUILD, nodeVersion: '18.x' } } }, + opts: { + archiveFormat: ARCHIVE_FORMAT.NONE, + config: { '*': { nodeBundler: NODE_BUNDLER.ESBUILD, nodeVersion: '18.x' } }, + }, }) expect(build).toHaveBeenCalledWith(expect.objectContaining({ target: ['node18'] })) diff --git a/tests/main.test.ts b/tests/main.test.ts index 21e950441..5562a2da6 100644 --- a/tests/main.test.ts +++ b/tests/main.test.ts @@ -12,6 +12,7 @@ import { dir as getTmpDir, tmpName } from 'tmp-promise' import unixify from 'unixify' import { afterAll, afterEach, beforeAll, describe, expect, test, vi } from 'vitest' +import { ARCHIVE_FORMAT } from '../src/archive.js' import { ESBUILD_LOG_LIMIT } from '../src/runtimes/node/bundlers/esbuild/bundler.js' import { NODE_BUNDLER } from '../src/runtimes/node/bundlers/types.js' import { detectEsModule } from '../src/runtimes/node/utils/detect_es_module.js' @@ -305,7 +306,7 @@ describe('zip-it-and-ship-it', () => { const length = 4 const fixtureName = 'local-require-esm' const opts = merge(options, { - archiveFormat: 'none' as const, + archiveFormat: ARCHIVE_FORMAT.NONE, basePath: join(FIXTURES_DIR, fixtureName), config: { '*': { @@ -1201,7 +1202,7 @@ describe('zip-it-and-ship-it', () => { testMany('Generates a directory if `archiveFormat` is set to `none`', [...allBundleConfigs], async (options) => { const opts = merge(options, { - archiveFormat: 'none' as const, + archiveFormat: ARCHIVE_FORMAT.NONE, }) const { files } = await zipNode('node-module-included', { opts, @@ -1574,7 +1575,7 @@ describe('zip-it-and-ship-it', () => { const fixtureName = 'node-module-dynamic-import-4' const { tmpDir } = await zipNode(fixtureName, { opts: { - archiveFormat: 'none', + archiveFormat: ARCHIVE_FORMAT.NONE, basePath: join(FIXTURES_DIR, fixtureName), config: { '*': { nodeBundler: NODE_BUNDLER.ESBUILD } }, }, @@ -2180,7 +2181,7 @@ describe('zip-it-and-ship-it', () => { const basePath = join(FIXTURES_DIR, fixtureName) const { files } = await zipFixture(fixtureName, { opts: { - archiveFormat: 'none', + archiveFormat: ARCHIVE_FORMAT.NONE, basePath, config: { '*': { nodeBundler: NODE_BUNDLER.NFT, nodeSourcemap: true } }, }, diff --git a/tests/zip_function.test.ts b/tests/zip_function.test.ts index 9a3881f44..530bb4059 100644 --- a/tests/zip_function.test.ts +++ b/tests/zip_function.test.ts @@ -6,7 +6,7 @@ import { dir as getTmpDir } from 'tmp-promise' import unixify from 'unixify' import { describe, expect, test } from 'vitest' -import { NODE_BUNDLER, zipFunction } from '../src/main.js' +import { ARCHIVE_FORMAT, NODE_BUNDLER, zipFunction } from '../src/main.js' import { FIXTURES_DIR, getBundlerNameFromOptions, importFunctionFile, unzipFiles } from './helpers/main.js' import { allBundleConfigs, getNodeBundlerString, testMany } from './helpers/test_many.js' @@ -83,7 +83,7 @@ describe('zipFunction', () => { await writeFile(testFilePath, 'module.exports = true') await zipFunction(`${FIXTURES_DIR}/simple/function.js`, tmpDir, { - archiveFormat: 'none', + archiveFormat: ARCHIVE_FORMAT.NONE, }) const functionEntry = await importFunctionFile(`${functionDirectory}/function.js`)