Skip to content

Commit

Permalink
chore: use latest testkit
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 4, 2022
1 parent c9d94cd commit 76b5c5d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 3 additions & 5 deletions test/nuts/field.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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(
Expand All @@ -43,7 +41,7 @@ describe('generate field NUTs', () => {
'default',
'tabs'
)}`;
execCmd(command, { ensureExitCode: 1, cli: 'sf' });
execCmd(command, { ensureExitCode: 1 });
});
});
});
2 changes: 0 additions & 2 deletions test/nuts/fs.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
Expand Down
7 changes: 2 additions & 5 deletions test/nuts/platformevent.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 });
});
});
});
9 changes: 3 additions & 6 deletions test/nuts/sobject.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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 });
});
});
});
6 changes: 2 additions & 4 deletions test/nuts/tab.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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', () => {
Expand All @@ -38,7 +36,7 @@ describe('generate tab NUTs', () => {
'default',
'objects'
)}`;
execCmd(command, { ensureExitCode: 1, cli: 'sf' });
execCmd(command, { ensureExitCode: 1 });
});
});
});
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 76b5c5d

Please sign in to comment.