diff --git a/test/nut/agent-test-run.nut.ts b/test/nut/agent-test-run.nut.ts new file mode 100644 index 0000000..9be6099 --- /dev/null +++ b/test/nut/agent-test-run.nut.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; +import { expect } from 'chai'; +import { AgentTestRunResult } from '../../src/commands/agent/test/run.js'; + +let testSession: TestSession; + +describe('agent test run NUTs', () => { + before('prepare session', async () => { + testSession = await TestSession.create(); + }); + + after(async () => { + await testSession?.clean(); + }); + + it('should return a job ID', () => { + const result = execCmd('agent test run -i 4KBSM000000003F4AQ --json', { ensureExitCode: 0 }) + .jsonOutput?.result; + expect(result?.success).to.equal(true); + expect(result?.jobId).to.be.ok; + }); +});