Skip to content

Commit

Permalink
test: remove error name assertions (let SDR handle)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jul 26, 2024
1 parent bf4cb5a commit f28fd65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 1 addition & 2 deletions test/nuts/seeds/deploy.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ context('Deploy metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const deploy = await testkit.deploy({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
testkit.expect.errorToHaveName(deploy ?? {}, 'SfError');
await testkit.deploy({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
});

it('should not deploy metadata outside of a package directory', async () => {
Expand Down
4 changes: 1 addition & 3 deletions test/nuts/seeds/retrieve.metadata.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { SourceTestkit } from '@salesforce/source-testkit';
import { JsonMap } from '@salesforce/ts-types';
import { RepoConfig, TEST_REPOS_MAP } from '../testMatrix.js';

// DO NOT TOUCH. generateNuts.ts will insert these values
Expand Down Expand Up @@ -70,8 +69,7 @@ context('Retrieve metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const retrieve = (await testkit.retrieve({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 })) as JsonMap;
testkit.expect.errorToHaveName(retrieve, 'SfError');
await testkit.retrieve({ args: '--metadata DOES_NOT_EXIST', exitCode: 1 });
});
});
});
6 changes: 2 additions & 4 deletions test/nuts/seeds/retrieve.retrievetargetdir.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import { fileURLToPath } from 'node:url';
import { SourceTestkit } from '@salesforce/source-testkit';
import { JsonMap } from '@salesforce/ts-types';
import { RepoConfig, TEST_REPOS_MAP } from '../testMatrix.js';

// DO NOT TOUCH. generateNuts.ts will insert these values
Expand Down Expand Up @@ -45,11 +44,10 @@ context('Retrieve metadata NUTs [name: %REPO_NAME%]', () => {
}

it('should throw an error if the metadata is not valid', async () => {
const retrieve = (await testkit.retrieve({
await testkit.retrieve({
args: '--retrievetargetdir targetdir --metadata DOES_NOT_EXIST',
exitCode: 1,
})) as JsonMap;
testkit.expect.errorToHaveName(retrieve, 'SfError');
});
});
});
});

0 comments on commit f28fd65

Please sign in to comment.