diff --git a/package.json b/package.json index 80c68ba6..165c9a7e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@oclif/plugin-command-snapshot": "^3.2.1", "@oclif/test": "^2.2.1", - "@salesforce/cli-plugins-testkit": "^2.5.3", + "@salesforce/cli-plugins-testkit": "^3.0.3", "@salesforce/dev-config": "^3.1.0", "@salesforce/dev-scripts": "^3.1.0", "@salesforce/plugin-command-reference": "^2.2.8", diff --git a/test/nuts/field.nut.ts b/test/nuts/field.nut.ts index 7cff451a..533db719 100644 --- a/test/nuts/field.nut.ts +++ b/test/nuts/field.nut.ts @@ -7,14 +7,12 @@ import * as path from 'path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { env } from '@salesforce/kit'; // import { expect } from 'chai'; describe('generate field NUTs', () => { let session: TestSession; before(async () => { - env.setString('TESTKIT_EXECUTABLE_PATH', path.join(process.cwd(), 'bin', 'dev')); session = await TestSession.create({ project: { name: 'field-nut', @@ -28,13 +26,13 @@ describe('generate field NUTs', () => { it('help should not throw', () => { const command = 'generate metadata field --help'; - execCmd(command, { ensureExitCode: 0, cli: 'sf' }).shellOutput.stdout; + execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout; }); describe('flag validation failures', () => { it('short label', () => { const command = 'generate metadata field --label yo'; - execCmd(command, { ensureExitCode: 1, cli: 'sf' }); + execCmd(command, { ensureExitCode: 1 }); }); it('bad object dir', () => { const command = `generate metadata field --label longEnough --object ${path.join( @@ -43,7 +41,7 @@ describe('generate field NUTs', () => { 'default', 'tabs' )}`; - execCmd(command, { ensureExitCode: 1, cli: 'sf' }); + execCmd(command, { ensureExitCode: 1 }); }); }); }); diff --git a/test/nuts/fs.nut.ts b/test/nuts/fs.nut.ts index c5acd932..bed014da 100644 --- a/test/nuts/fs.nut.ts +++ b/test/nuts/fs.nut.ts @@ -8,7 +8,6 @@ import * as path from 'path'; import * as fs from 'fs'; import { TestSession } from '@salesforce/cli-plugins-testkit'; -import { env } from '@salesforce/kit'; import { expect } from 'chai'; import { getDirectoriesThatContainObjects, @@ -25,7 +24,6 @@ describe('local fs NUTs', () => { const forceAppObjectsPath = path.join('force-app', 'main', 'default', 'objects'); before(async () => { - env.setString('TESTKIT_EXECUTABLE_PATH', path.join(process.cwd(), 'bin', 'dev')); session = await TestSession.create({ project: { gitClone: 'https://github.com/salesforcecli/sample-project-multiple-packages', diff --git a/test/nuts/platformevent.nut.ts b/test/nuts/platformevent.nut.ts index c004a265..bfdf5bba 100644 --- a/test/nuts/platformevent.nut.ts +++ b/test/nuts/platformevent.nut.ts @@ -5,16 +5,13 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { env } from '@salesforce/kit'; // import { expect } from 'chai'; describe('generate platformevent NUTs', () => { let session: TestSession; before(async () => { - env.setString('TESTKIT_EXECUTABLE_PATH', path.join(process.cwd(), 'bin', 'dev')); session = await TestSession.create({ project: { name: 'platformevent-nut', @@ -28,13 +25,13 @@ describe('generate platformevent NUTs', () => { it('help should not throw', () => { const command = 'generate metadata platformevent --help'; - execCmd(command, { ensureExitCode: 0, cli: 'sf' }); + execCmd(command, { ensureExitCode: 0 }); }); describe('flag validation failures', () => { it('short label', () => { const command = 'generate metadata platformevent --label yo'; - execCmd(command, { ensureExitCode: 1, cli: 'sf' }); + execCmd(command, { ensureExitCode: 1 }); }); }); }); diff --git a/test/nuts/sobject.nut.ts b/test/nuts/sobject.nut.ts index ec6306e5..9cf089db 100644 --- a/test/nuts/sobject.nut.ts +++ b/test/nuts/sobject.nut.ts @@ -5,17 +5,14 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import * as path from 'path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { env } from '@salesforce/kit'; // import { expect } from 'chai'; describe('generate sobject NUTs', () => { let session: TestSession; before(async () => { - env.setString('TESTKIT_EXECUTABLE_PATH', path.join(process.cwd(), 'bin', 'dev')); - session = await TestSession.create({}); + session = await TestSession.create(); }); after(async () => { @@ -24,13 +21,13 @@ describe('generate sobject NUTs', () => { it('help should not throw', () => { const command = 'generate metadata sobject --help'; - execCmd(command, { ensureExitCode: 0, cli: 'sf' }); + execCmd(command, { ensureExitCode: 0 }); }); describe('flag validation failures', () => { it('short label', () => { const command = 'generate metadata sobject --label yo'; - execCmd(command, { ensureExitCode: 1, cli: 'sf' }); + execCmd(command, { ensureExitCode: 1 }); }); }); }); diff --git a/test/nuts/tab.nut.ts b/test/nuts/tab.nut.ts index 4f5ca44f..445f41eb 100644 --- a/test/nuts/tab.nut.ts +++ b/test/nuts/tab.nut.ts @@ -7,14 +7,12 @@ import * as path from 'path'; import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { env } from '@salesforce/kit'; // import { expect } from 'chai'; describe('generate tab NUTs', () => { let session: TestSession; before(async () => { - env.setString('TESTKIT_EXECUTABLE_PATH', path.join(process.cwd(), 'bin', 'dev')); session = await TestSession.create({ project: { name: 'tab-nut', @@ -28,7 +26,7 @@ describe('generate tab NUTs', () => { it('help should not throw', () => { const command = 'generate metadata tab --help'; - execCmd(command, { ensureExitCode: 0, cli: 'sf' }); + execCmd(command, { ensureExitCode: 0 }); }); describe('flag validation failures', () => { it('invalid folder', () => { @@ -38,7 +36,7 @@ describe('generate tab NUTs', () => { 'default', 'objects' )}`; - execCmd(command, { ensureExitCode: 1, cli: 'sf' }); + execCmd(command, { ensureExitCode: 1 }); }); }); }); diff --git a/yarn.lock b/yarn.lock index d01b2bd1..4280a8c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -931,10 +931,10 @@ mv "~2" safe-json-stringify "~1" -"@salesforce/cli-plugins-testkit@^2.5.3": - version "2.5.3" - resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-2.5.3.tgz#80d6d640f1fccb8975e0648361ffa984e30b26d3" - integrity sha512-wK94o+JHe1S05kjvqpZzGFKFAGn/J1NAKq953JdoBqjSCbyhEzAWgjaABxFTirJk3zPMX1/vR7BFmsN+E5ju9w== +"@salesforce/cli-plugins-testkit@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@salesforce/cli-plugins-testkit/-/cli-plugins-testkit-3.0.3.tgz#1a174653a33c919b19990353c67900507d1c87b3" + integrity sha512-buXtuKvbO65bwbZSU8o9o135w4eEcel5XwbN/dUnsdBfra64KkVP6uqyFo/HDNsEC5QJ5S8MBwWT/AcQ2L3Dew== dependencies: "@salesforce/core" "^3.30.9" "@salesforce/kit" "^1.6.1"