Skip to content

Commit

Permalink
fix: add warnings to jsonOutput type (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiand391 authored Jul 11, 2023
1 parent 550cae0 commit ef54e8a
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
55 changes: 54 additions & 1 deletion SAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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';

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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';

/*
Expand Down
2 changes: 1 addition & 1 deletion src/execCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type ExecCmdOptions = ExecOptions &
// eslint-disable-next-line @typescript-eslint/no-explicit-any
type ExcludeMethods<T> = Pick<T, NonNullable<{ [K in keyof T]: T[K] extends (_: any) => any ? never : K }[keyof T]>>;

export type JsonOutput<T> = { status: number; result: T } & Partial<ExcludeMethods<SfError>>;
export type JsonOutput<T> = { status: number; result: T; warnings: string[] } & Partial<ExcludeMethods<SfError>>;

export interface ExecCmdResult<T> {
/**
Expand Down

0 comments on commit ef54e8a

Please sign in to comment.