@salesforce/source-testkit 0.0.17 → 0.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.0.18](https://github.com/salesforcecli/source-testkit/compare/v0.0.17...v0.0.18) (2022-03-08)
6
+
7
+ ### Features
8
+
9
+ - make type changes to make testing sf easier ([#59](https://github.com/salesforcecli/source-testkit/issues/59)) ([7752ed6](https://github.com/salesforcecli/source-testkit/commit/7752ed66eff3be11c9fa6921223f277427334fab))
10
+
5
11
  ### [0.0.17](https://github.com/salesforcecli/source-testkit/compare/v0.0.16...v0.0.17) (2022-02-12)
6
12
 
7
13
  ### [0.0.16](https://github.com/salesforcecli/source-testkit/compare/v0.0.15...v0.0.16) (2021-10-13)
package/lib/testkit.d.ts CHANGED
@@ -58,9 +58,9 @@ export declare class SourceTestkit extends AsyncCreatable<SourceTestkit.Options>
58
58
  /**
59
59
  * Executes force:source:deploy
60
60
  */
61
- deploy(options?: Partial<SourceTestkit.CommandOpts>): Promise<Result<{
61
+ deploy<T = {
62
62
  id: string;
63
- }>>;
63
+ }>(options?: Partial<SourceTestkit.CommandOpts>): Promise<Result<T>>;
64
64
  /**
65
65
  * Executes force:source:deploy:report
66
66
  */
package/lib/testkit.js CHANGED
@@ -346,7 +346,7 @@ class SourceTestkit extends kit_1.AsyncCreatable {
346
346
  ? cli_plugins_testkit_1.execCmd(command, { ensureExitCode: exitCode, cli: 'sf' })
347
347
  : cli_plugins_testkit_1.execCmd(command, { ensureExitCode: exitCode, cli: 'sfdx' });
348
348
  await this.fileTracker.updateAll(`POST: ${command}`);
349
- if (json && this.executableName === Executable.SFDX) {
349
+ if (json) {
350
350
  const jsonOutput = result.jsonOutput;
351
351
  this.debug('%O', jsonOutput);
352
352
  if (!jsonOutput) {
@@ -361,15 +361,6 @@ class SourceTestkit extends kit_1.AsyncCreatable {
361
361
  }
362
362
  return jsonOutput;
363
363
  }
364
- if (json && this.executableName === Executable.SF) {
365
- const jsonOutput = result.jsonOutput;
366
- this.debug('%O', jsonOutput);
367
- if (!jsonOutput) {
368
- console.error(`${command} returned null jsonOutput`);
369
- console.error(result);
370
- }
371
- return jsonOutput;
372
- }
373
364
  }
374
365
  catch (err) {
375
366
  const error = err;
package/lib/types.d.ts CHANGED
@@ -1,11 +1,9 @@
1
1
  import { Connection } from '@salesforce/core';
2
2
  import { JsonCollection, JsonMap, Nullable } from '@salesforce/ts-types';
3
- export declare type SfdxResult<T = JsonMap> = Nullable<JsonMap & {
3
+ export declare type Result<T = JsonCollection> = Nullable<JsonMap & {
4
4
  status: number;
5
5
  result: T;
6
6
  }>;
7
- export declare type SfResult<T = JsonCollection> = Nullable<T>;
8
- export declare type Result<T = JsonCollection> = SfdxResult<T> | SfResult<T>;
9
7
  export declare type Context = {
10
8
  projectDir: string;
11
9
  connection: Nullable<Connection>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/source-testkit",
3
3
  "description": "testkit for running NUTs for source related commands",
4
- "version": "0.0.17",
4
+ "version": "0.0.18",
5
5
  "author": "Salesforce",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "lib/index.js",
@@ -69,7 +69,7 @@
69
69
  "nyc": "^15.1.0",
70
70
  "prettier": "^2.0.5",
71
71
  "pretty-quick": "^3.1.0",
72
- "sinon": "10.0.0",
72
+ "sinon": "^10.0.0",
73
73
  "ts-node": "^10.0.0",
74
74
  "typescript": "^4.1.3"
75
75
  },