-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start explorations of automated testing by bringing the boilerplate test code up to the most recent version from sfdx plugins:generate Related to: #133
- Loading branch information
1 parent
3c35c24
commit a63a679
Showing
1 changed file
with
9 additions
and
4 deletions.
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 |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import { expect, test } from '@salesforce/command/dist/test'; | ||
import { expect, test } from '@salesforce/command/lib/test'; | ||
import { ensureJsonMap, ensureString } from '@salesforce/ts-types'; | ||
|
||
describe('hello:org', () => { | ||
test | ||
.withOrg({ username: 'test@org.com' }, true) | ||
.withConnectionRequest(function() { | ||
return Promise.resolve({ records: [ { Name: 'Super Awesome Org', TrialExpirationDate: '2018-03-20T23:24:11.000+0000'}]}); | ||
.withConnectionRequest(request => { | ||
const requestMap = ensureJsonMap(request); | ||
if (ensureString(requestMap.url).match(/Organization/)) { | ||
return Promise.resolve({ records: [ { Name: 'Super Awesome Org', TrialExpirationDate: '2018-03-20T23:24:11.000+0000'}] }); | ||
} | ||
return Promise.resolve({ records: [] }); | ||
}) | ||
.stdout() | ||
.command(['hello:org', '--targetusername', 'test@org.com']) | ||
.it('runs hello:org --targetusername test@org.com', (ctx) => { | ||
.it('runs hello:org --targetusername test@org.com', ctx => { | ||
expect(ctx.stdout).to.contain('Hello world! This is org: Super Awesome Org and I will be around until Tue Mar 20 2018!'); | ||
}); | ||
}); |