-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(nx-heroku): add extra e2e test to run deploy executor with minim…
…al options
- Loading branch information
Showing
1 changed file
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,45 @@ describe('nx-heroku e2e', () => { | |
expect(project.targets?.deploy?.options?.email).toEqual(HEROKU_EMAIL); | ||
}, 120000); | ||
|
||
it('should create target and deploy the app successfully', async () => { | ||
it('should create target and deploy an app with simple configuration successfully', async () => { | ||
const { projectName, getProjectConfig, updateProjectConfig } = | ||
await createProject(); | ||
|
||
projects.push(projectName); | ||
// restore the environment variables to be expanded by the executor | ||
process.env.HEROKU_API_KEY = process.env.HEROKU_API_KEY_PREV; | ||
process.env.HEROKU_EMAIL = process.env.HEROKU_EMAIL_PREV; | ||
// configure the target | ||
await runNxCommandAsync( | ||
`generate @getlarge/nx-heroku:deploy ${projectName} --appNamePrefix=aloes` | ||
); | ||
const project = getProjectConfig(); | ||
project.targets!.deploy.options = { | ||
...(project.targets!.deploy.options || {}), | ||
procfile: `web: node dist/apps/${projectName}/main.js`, | ||
buildPacks: ['heroku/nodejs'], | ||
apiKey: HEROKU_API_KEY, | ||
email: HEROKU_EMAIL, | ||
variables: { | ||
// used in postbuild.js | ||
PROJECT_NAME: projectName, | ||
}, | ||
useForce: true, | ||
serviceUser: '[email protected]', | ||
debug: true, | ||
}; | ||
updateProjectConfig(project); | ||
prepareProjectForDeployment(projectName); | ||
// run the target | ||
const { stderr, stdout } = await runNxCommandAsync( | ||
`deploy ${projectName} --verbose`, | ||
{ silenceError: true } | ||
); | ||
console.warn(stdout, stderr); | ||
expect(stdout).toContain('Deployment successful.'); | ||
}, 100000); | ||
|
||
it('should create target and deploy the app with complex configuration successfully', async () => { | ||
const { projectName, getProjectConfig, updateProjectConfig } = | ||
await createProject(); | ||
|
||
|