diff --git a/aio/scripts/deploy-to-firebase.js b/aio/scripts/deploy-to-firebase.js index 1f700dda00..a381a7a592 100644 --- a/aio/scripts/deploy-to-firebase.js +++ b/aio/scripts/deploy-to-firebase.js @@ -30,7 +30,7 @@ if (require.main === module) { console.log(deploymentInfo.reason); } else { console.log( - `Git branch : ${currentBranch}\n` + + `Git branch : ${inputVars.currentBranch}\n` + `Build/deploy mode : ${deploymentInfo.deployEnv}\n` + `Firebase project : ${deploymentInfo.projectId}\n` + `Firebase site : ${deploymentInfo.siteId}\n` + diff --git a/aio/scripts/deploy-to-firebase.spec.js b/aio/scripts/deploy-to-firebase.spec.js index 1633b983d2..02a09a3aed 100644 --- a/aio/scripts/deploy-to-firebase.spec.js +++ b/aio/scripts/deploy-to-firebase.spec.js @@ -1,6 +1,7 @@ #!/usr/bin/env node 'use strict'; +const {execSync} = require('child_process'); const {computeDeploymentInfo, computeInputVars, getLatestCommit} = require('./deploy-to-firebase'); @@ -259,4 +260,23 @@ describe('deploy-to-firebase:', () => { 'There is a more recent branch with the same major version: "4.4.x"', }); }); + + it('integration - should run the main script without error', () => { + const cmd = `"${process.execPath}" "${__dirname}/deploy-to-firebase" --dry-run`; + const env = { + CI_REPO_OWNER: 'angular', + CI_REPO_NAME: 'angular', + CI_PULL_REQUEST: 'false', + CI_BRANCH: 'master', + CI_COMMIT: getLatestCommit('master') + }; + const result = execSync(cmd, {encoding: 'utf8', env}).trim(); + expect(result).toBe( + 'Git branch : master\n' + + 'Build/deploy mode : next\n' + + 'Firebase project : angular-io\n' + + 'Firebase site : next-angular-io-site\n' + + 'Deployment URLs : https://next.angular.io/\n' + + ' https://next-angular-io-site.web.app/'); + }); });