From 6620bfc96b3f5345c02fbc6c65a013fadf47ebf4 Mon Sep 17 00:00:00 2001 From: Tim Noonan Date: Tue, 4 Dec 2018 16:01:29 -0700 Subject: [PATCH] fix: carrot dev config update template --- src/generators/app.ts | 2 +- templates/sfdxPlugin/test/command.test.ts.ejs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/generators/app.ts b/src/generators/app.ts index b4c8af4..5177a0b 100644 --- a/src/generators/app.ts +++ b/src/generators/app.ts @@ -464,7 +464,7 @@ class App extends Generator { '@oclif/dev-cli@^1', '@oclif/plugin-help@^2', 'globby@^8', - '@salesforce/dev-config@1.1.4', + '@salesforce/dev-config@^1.1.4', 'sinon@5', ) break diff --git a/templates/sfdxPlugin/test/command.test.ts.ejs b/templates/sfdxPlugin/test/command.test.ts.ejs index 077bcae..3f17593 100644 --- a/templates/sfdxPlugin/test/command.test.ts.ejs +++ b/templates/sfdxPlugin/test/command.test.ts.ejs @@ -1,10 +1,12 @@ -import { expect, test } from '@salesforce/command/dist/test'; +import { expect, test } from '@salesforce/command/lib/test'; +import { AnyJson, ensureJsonMap, ensureString } from '@salesforce/ts-types'; describe('<%- topic %>:<%- name %>', () => { test .withOrg({ username: 'test@org.com' }, true) .withConnectionRequest(request => { - if (request.url.match(/Organization/)) { + 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: [] });