Skip to content

Commit c6a1913

Browse files
committed
test: assert error name, not message
1 parent 3e865e9 commit c6a1913

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

test/nut/legacy/create.nut.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import * as path from 'path';
88
import { assert, expect } from 'chai';
99
import { TestSession, execCmd, genUniqueString } from '@salesforce/cli-plugins-testkit';
10-
import { ScratchOrgCreateResult, Messages } from '@salesforce/core';
10+
import { ScratchOrgCreateResult } from '@salesforce/core';
1111

1212
let session: TestSession;
1313

@@ -43,16 +43,8 @@ describe('org:create command', () => {
4343
{
4444
ensureExitCode: 1,
4545
}
46-
).jsonOutput as unknown as { message: string };
47-
48-
Messages.importMessagesDirectory(
49-
// 'messages' is appended to the path
50-
path.join(__dirname, '..', '..', '..', 'node_modules', '@salesforce', 'core'),
51-
false,
52-
'@salesforce/core'
53-
);
54-
const messages = Messages.loadMessages('@salesforce/core', 'scratchOrgErrorCodes');
55-
expect(errorOutput.message).to.be.a('string').and.to.include(messages.getMessage('C-1007'));
46+
).jsonOutput as unknown as { name: string };
47+
expect(errorOutput.name).to.be.a('string').and.include('C-1007');
5648
});
5749
});
5850

0 commit comments

Comments
 (0)