From ef54e8a66ffe8ff4f5d9832e77707128447d3f0d Mon Sep 17 00:00:00 2001 From: Cristian Dominguez <6853656+cristiand391@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:49:34 -0300 Subject: [PATCH] fix: add warnings to jsonOutput type (#512) --- SAMPLES.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- src/execCmd.ts | 2 +- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/SAMPLES.md b/SAMPLES.md index 740e1748..04b9903c 100644 --- a/SAMPLES.md +++ b/SAMPLES.md @@ -101,6 +101,12 @@ describe('execCmd', () => { ```typescript import { execCmd } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('execCmd', () => { // This would actually be set in the shell or CI environment. @@ -167,6 +173,12 @@ A TestSession provides conveniences to testing plugin commands with options to a ```typescript import { execCmd, TestSession, TestProject } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('TestSession', () => { let testSession: TestSession; @@ -252,6 +264,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('TestSession', () => { let testSession: TestSession; @@ -276,7 +294,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; -import { expect } from 'chai'; +/* + * Copyright (c) 2023, 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 { tmpdir } from 'os'; import { expect } from 'chai'; @@ -358,6 +381,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('TestSession', () => { let testSession: TestSession; @@ -388,6 +417,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession, TestProject } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('TestSession', () => { let testSession: TestSession; @@ -420,6 +455,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession, TestProject } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 + */ describe('TestSession', () => { let testSession: TestSession; @@ -450,6 +491,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession, TestProject } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 * as path from 'path'; describe('TestSession', () => { @@ -490,6 +537,12 @@ describe('TestSession', () => { ```typescript import { execCmd, TestSession } from '@salesforce/cli-plugins-testkit'; +/* + * Copyright (c) 2023, 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 * as shelljs from 'shelljs'; /* diff --git a/src/execCmd.ts b/src/execCmd.ts index 0932b8d9..5b94f752 100644 --- a/src/execCmd.ts +++ b/src/execCmd.ts @@ -42,7 +42,7 @@ export type ExecCmdOptions = ExecOptions & // eslint-disable-next-line @typescript-eslint/no-explicit-any type ExcludeMethods = Pick any ? never : K }[keyof T]>>; -export type JsonOutput = { status: number; result: T } & Partial>; +export type JsonOutput = { status: number; result: T; warnings: string[] } & Partial>; export interface ExecCmdResult { /**