Skip to content

Commit

Permalink
refactor(test): Return test code to normal
Browse files Browse the repository at this point in the history
Update mock input sequence inside create.test.ts. Update testbed ADK
project to use the latest schema for sfdx-project.json. Turn tslint back
on as part of post-test actions.

Related to: #139
  • Loading branch information
VivekMChawla committed May 9, 2019
1 parent d75b004 commit d14ec3d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"repository": "sfdx-isv/sfdx-falcon",
"scripts": {
"postpack": "rm -f oclif.manifest.json npm-shrinkwrap.json",
"posttest": "#tslint -p test -t stylish",
"posttest": "tslint -p test -t stylish",
"prepare": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme && npm shrinkwrap",
"test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
"version": "oclif-dev readme && git add README.md"
Expand Down
30 changes: 16 additions & 14 deletions test/integration-tests/commands/falcon/adk/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@ describe('falcon:adk:create', () => {
'falcon:adk:create' // First member of the array must be the CLI command we want to run.
],
[
{input: KEY.ENTER, delay: 45000}, // Choose first DevHub listed
{input: KEY.ENTER, delay: 500}, // ???
{input: KEY.ENTER, delay: 500}, // ???
{input: 'N' + KEY.ENTER, delay: 500}, // ???
{input: 'Y' + KEY.ENTER, delay: 500}, // ???
{input: KEY.ENTER, delay: 500}, // ???
{input: KEY.ENTER, delay: 500}, // ???
{input: KEY.ENTER, delay: 500}, // ???
{input: KEY.ENTER, delay: 500}, // ???
{input: 'Y' + KEY.ENTER, delay: 500} // ???
{input: KEY.ENTER, delay: 45000}, // Choose default Target Directory
{input: KEY.ENTER, delay: 500}, // Choose first DevHub on the list
{input: KEY.ENTER, delay: 500}, // Choose first EnvHub on the list
{input: KEY.ENTER, delay: 500}, // Choose default Company Name
{input: KEY.ENTER, delay: 500}, // Choose default Company Alias
{input: KEY.ENTER, delay: 500}, // Choose default Project Name
{input: KEY.ENTER, delay: 500}, // Choose default Project Alias
{input: 'Y' + KEY.ENTER, delay: 500}, // Choose YES to initialize Git
{input: 'Y' + KEY.ENTER, delay: 500}, // Choose YES that I've created a remote Git Repo
{input: KEY.ENTER, delay: 500}, // Choose default Git Remote URI
{input: 'Y' + KEY.ENTER, delay: 2000}, // Choose YES to continue with unreachable Git Remote
{input: 'Y' + KEY.ENTER, delay: 500} // Choose YES to create a new ADK project
],
{
envVars: {
Expand All @@ -65,10 +67,10 @@ describe('falcon:adk:create', () => {
// Check final output for success indicators.
// TODO: Figure out why the git stage/commit step works locally but not at CircleCI
// In the meantime, let's just focus on an exit code of ZERO to indicate success.
// expect(commandResponse.stdoutLines)
// .to
// .include('Command Succeded : falcon:adk:create completed successfully',
// 'FAILURE! Final output missing success message');
expect(commandResponse.stdoutLines)
.to
.include('Command Succeded : falcon:adk:create completed successfully, but with some warnings (see above)',
'FAILURE! Incorrect Final Status message');
}).timeout(120000);

//───────────────────────────────────────────────────────────────────────────┐
Expand Down
8 changes: 4 additions & 4 deletions test/integration-tests/commands/falcon/adk/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ describe('falcon:adk:install', () => {
],
{
envVars: {
SFDX_JSON_TO_STDOUT: true, // Sends all JSON output to STDOUT
SFDX_AUTOUPDATE_DISABLE: true // Disables the Salesforce CLI AutoUpdate feature
SFDX_JSON_TO_STDOUT: true, // Sends all JSON output to STDOUT
SFDX_AUTOUPDATE_DISABLE: true // Disables the Salesforce CLI AutoUpdate feature
},
workingDir: path.join(process.env.FALCON_TEST_PROJECTDIR, 'adk-test-01'),
showStdout: process.env.FALCON_TEST_SHOW_STDOUT ? true : false,
Expand Down Expand Up @@ -90,8 +90,8 @@ describe('falcon:adk:install', () => {
],
{
envVars: {
SFDX_JSON_TO_STDOUT: true, // Sends all JSON output to STDOUT
SFDX_AUTOUPDATE_DISABLE: true // Disables the Salesforce CLI AutoUpdate feature
SFDX_JSON_TO_STDOUT: true, // Sends all JSON output to STDOUT
SFDX_AUTOUPDATE_DISABLE: true // Disables the Salesforce CLI AutoUpdate feature
},
workingDir: path.join(process.env.FALCON_TEST_PROJECTDIR, 'adk-test-01'),
showStdout: process.env.FALCON_TEST_SHOW_STDOUT ? true : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"devHubAlias": "DevHub-PBO",
"envHubAlias": "NOT_SPECIFIED",
"pkgOrgAlias": "NOT_SPECIFIED",
"appxProject": {},
"appxDemo": {
"installedDemos": []
Expand Down
5 changes: 3 additions & 2 deletions test/projects/adk-test-01/sfdx-project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
{"path": "sfdx-source/force-app", "default": true}
],
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "44.0",
"sourceApiVersion": "45.0",
"plugins": {
"sfdxFalcon": {
"developerAlias" : "sfdc",
"developerName" : "Salesforce",
"projectAlias" : "adk-testbed",
"projectName" : "ADK Testbed",
"projectType" : "appx:single-demo",
"projectFamily" : "ADK",
"projectType" : "single-demo",
"defaultRecipe" : "falcon-test-01-recipe.json",
"gitRemoteUri" : "https://github.com/sfdx-isv/testbed-falcon-adk.git",
"gitHubUrl" : "https://github.com/sfdx-isv/testbed-falcon-adk",
Expand Down

0 comments on commit d14ec3d

Please sign in to comment.