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

Commit

Permalink
feat: add test for nodejs functions build from internal folder with d…
Browse files Browse the repository at this point in the history
…isplayName property
  • Loading branch information
khendrikse committed Jan 9, 2023
1 parent 2374e49 commit c656390
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = true
20 changes: 19 additions & 1 deletion tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ describe('zip-it-and-ship-it', () => {
expect(files[0].isInternalFunction).toBeFalsy()
})

testMany.only(
'Zips Node.js function filesfrom an internal-functions dir with a configured displayName',
[...allBundleConfigs, 'bundler_none'],
async (options) => {
const fixtureName = 'node-internal'
const { files } = await zipNode(fixtureName, {
length: 2,
fixtureDir: join(FIXTURES_DIR, FUNCTIONS_INTERNAL_DIR),
opts: { ...options, config: { 'function-1': { displayName: 'Function One' } } },
})

expect(files).toHaveLength(2)
expect(files[0].isInternalFunction).toBeTruthy()
expect(files[0].displayName).toBe('Function One')
expect(files[1].displayName).toBeUndefined()
},
)

testMany(
'Handles Node module with native bindings (buildtime marker module)',
[...allBundleConfigs],
Expand Down Expand Up @@ -1905,7 +1923,7 @@ describe('zip-it-and-ship-it', () => {
)
})

test('Builds Rust functions from an internal-functions dir with a configured displayName ', async () => {
test('Builds Rust functions from an internal-functions dir with a configured displayName', async () => {
vi.mocked(shellUtils.runCommand).mockImplementation(async (...args) => {
// eslint-disable-next-line unicorn/no-useless-undefined
const [rootCommand, , { env: environment = undefined } = {}] = args
Expand Down

0 comments on commit c656390

Please sign in to comment.