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

Commit

Permalink
chore: add failing case to test
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas committed Oct 20, 2021
1 parent d51c860 commit dca5597
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/fixtures/node-monorepo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "local-node-module",
"version": "1.0.0",
"dependencies": {
"@netlify/mock-package": "1.0.0"
"@netlify/mock-package": "1.0.0",
"@netlify/mock-package-2": "1.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
module.exports = require('@netlify/mock-package')
const mock1 = require('@netlify/mock-package')
const mock2 = require('@netlify/mock-package-2')

module.exports = { mock1, mock2 }
10 changes: 8 additions & 2 deletions tests/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2175,15 +2175,21 @@ testMany(
const basePath = join(fixtureDir, 'packages', 'site-1', 'netlify', 'functions')
const opts = merge(options, {
basePath,
config: {
'*': {
externalNodeModules: ['@netlify/mock-package-2'],
},
},
repositoryRoot: fixtureDir,
})
const result = await zipFunction(`${basePath}/function-1.js`, tmpDir, opts)

await unzipFiles([result])

const { mock } = require(`${tmpDir}/function-1.js`)
const { mock1, mock2 } = require(`${tmpDir}/function-1.js`)

t.true(mock)
t.true(mock1)
t.true(mock2)
},
)

Expand Down

0 comments on commit dca5597

Please sign in to comment.