@salesforce/source-testkit 0.0.11 → 0.0.15
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 +23 -0
- package/lib/assertions.d.ts +5 -0
- package/lib/assertions.js +12 -0
- package/lib/testkit.js +3 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
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.15](https://github.com/salesforcecli/source-testkit/compare/v0.0.14...v0.0.15) (2021-09-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* use appropriate config key based on executable ([cc36ff8](https://github.com/salesforcecli/source-testkit/commit/cc36ff859c4fc7e4645043cccbd39b75c0cc253c))
|
|
11
|
+
|
|
12
|
+
### [0.0.14](https://github.com/salesforcecli/source-testkit/compare/v0.0.13...v0.0.14) (2021-09-08)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* convert correct sep ([#10](https://github.com/salesforcecli/source-testkit/issues/10)) ([6b9356b](https://github.com/salesforcecli/source-testkit/commit/6b9356b537932dd485cf448b6bdb0ab64c15a5f0))
|
|
18
|
+
|
|
19
|
+
### [0.0.13](https://github.com/salesforcecli/source-testkit/compare/v0.0.12...v0.0.13) (2021-09-01)
|
|
20
|
+
|
|
21
|
+
### [0.0.12](https://github.com/salesforcecli/source-testkit/compare/v0.0.11...v0.0.12) (2021-09-01)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* add filesToBeDeployedViaResult method ([#8](https://github.com/salesforcecli/source-testkit/issues/8)) ([bfc45b6](https://github.com/salesforcecli/source-testkit/commit/bfc45b6d42bded3e49e0ba2bea511e9a611da0bd))
|
|
27
|
+
|
|
5
28
|
### [0.0.11](https://github.com/salesforcecli/source-testkit/compare/v0.0.10...v0.0.11) (2021-08-17)
|
|
6
29
|
|
|
7
30
|
|
package/lib/assertions.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JsonMap } from '@salesforce/ts-types';
|
|
2
|
+
import { FileResponse } from '@salesforce/source-deploy-retrieve';
|
|
2
3
|
import { Context, SourceState, StatusResult } from './types';
|
|
3
4
|
import { ExecutionLog } from './executionLog';
|
|
4
5
|
import { FileTracker } from './fileTracker';
|
|
@@ -39,6 +40,10 @@ export declare class Assertions {
|
|
|
39
40
|
* Finds all files in project based on the provided globs and expects them to be updated on the server
|
|
40
41
|
*/
|
|
41
42
|
filesToBeDeployed(globs: string[], ignore?: string[], deployCommand?: string): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Finds all files in project based on the provided globs and expects them to be updated on the server by comparing to what was returned in the FileResponse[]
|
|
45
|
+
*/
|
|
46
|
+
filesToBeDeployedViaResult(globs: string[], ignore: string[] | undefined, result: FileResponse[]): Promise<void>;
|
|
42
47
|
/**
|
|
43
48
|
* Finds all files in project based on the provided globs and expects them to NOT be updated on the server
|
|
44
49
|
*/
|
package/lib/assertions.js
CHANGED
|
@@ -87,6 +87,18 @@ class Assertions {
|
|
|
87
87
|
async filesToBeDeployed(globs, ignore = [], deployCommand = this.commands.deploy) {
|
|
88
88
|
await this.filesToBeUpdated(globs, ignore, deployCommand);
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Finds all files in project based on the provided globs and expects them to be updated on the server by comparing to what was returned in the FileResponse[]
|
|
92
|
+
*/
|
|
93
|
+
async filesToBeDeployedViaResult(globs, ignore = [], result) {
|
|
94
|
+
const all = await this.doGlob(globs);
|
|
95
|
+
const ignoreFiles = await this.doGlob(ignore, false);
|
|
96
|
+
// glob will return files with '/' as separators, this won't work on Windows
|
|
97
|
+
const toTrack = all.filter((file) => !ignoreFiles.includes(file)).map((file) => file.replace(/\//g, path.sep));
|
|
98
|
+
result.map((source) => {
|
|
99
|
+
chai_1.expect(toTrack, `toTrack: ${toTrack.join('\n')}, missing file : ${source.filePath}`).to.include(source.filePath);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
90
102
|
/**
|
|
91
103
|
* Finds all files in project based on the provided globs and expects them to NOT be updated on the server
|
|
92
104
|
*/
|
package/lib/testkit.js
CHANGED
|
@@ -466,12 +466,10 @@ class SourceTestkit extends kit_1.AsyncCreatable {
|
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
468
|
async getDefaultUsername() {
|
|
469
|
-
const
|
|
469
|
+
const configVar = this.executableName === Executable.SF ? 'target-org' : core_1.Config.DEFAULT_USERNAME;
|
|
470
|
+
const configResult = cli_plugins_testkit_1.execCmd(`config:get ${configVar} --json`).jsonOutput;
|
|
470
471
|
const results = ts_types_1.get(configResult, 'result', configResult);
|
|
471
|
-
const username = results.find((r) => r.key ===
|
|
472
|
-
if (this.executableName === Executable.SF) {
|
|
473
|
-
cli_plugins_testkit_1.execCmd(`config:set target-org ${username} --json`);
|
|
474
|
-
}
|
|
472
|
+
const username = results.find((r) => r.key === configVar || r.name === configVar).value;
|
|
475
473
|
return username;
|
|
476
474
|
}
|
|
477
475
|
async createConnection() {
|
package/package.json
CHANGED