Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
chore: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas committed Oct 13, 2023
1 parent 54858fb commit a8af287
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,14 +577,21 @@ describe('zip-it-and-ship-it', () => {

testMany(
'Includes side files when the function is in a subdirectory',
['bundler_default', 'bundler_default_nft'],
async (options, bundler) => {
const shouldIncludeFiles = bundler === 'bundler_default' || bundler === 'bundler_default_nft'
[...allBundleConfigs],
async (options, variant) => {
const shouldIncludeFiles = variant === 'bundler_default' || variant === 'bundler_default_nft'
const { files } = await zipFixture('directory-side-files', { length: 2, opts: options })
const unzippedFunctions = await unzipFiles(files)
const [funcV1, funcV2] = unzippedFunctions
const expectedBundler = {
bundler_default: 'zisi',
bundler_esbuild: 'esbuild',
bundler_esbuild_zisi: 'esbuild',
bundler_default_nft: 'nft',
bundler_nft: 'nft',
}

expect(funcV1.bundler).toBe(bundler === 'bundler_default' ? 'zisi' : 'nft')
expect(funcV1.bundler).toBe(expectedBundler[variant])
expect(funcV1.runtimeAPIVersion).toBe(1)

if (shouldIncludeFiles) {
Expand Down

0 comments on commit a8af287

Please sign in to comment.