sf-delta-tests 0.0.3 → 0.0.4
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/README.md +0 -30
- package/package.json +1 -1
- package/lib/commands/delta/test-classes.d.ts +0 -21
- package/lib/commands/delta/test-classes.js +0 -55
- package/lib/commands/delta/test-classes.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -3
- package/lib/index.js.map +0 -1
- package/lib/services/apex-class-service.d.ts +0 -4
- package/lib/services/apex-class-service.js +0 -33
- package/lib/services/apex-class-service.js.map +0 -1
- package/lib/services/dependency-service.d.ts +0 -18
- package/lib/services/dependency-service.js +0 -84
- package/lib/services/dependency-service.js.map +0 -1
- package/lib/services/dependency-services.test.d.ts +0 -1
- package/lib/services/dependency-services.test.js +0 -27
- package/lib/services/dependency-services.test.js.map +0 -1
package/README.md
CHANGED
|
@@ -110,35 +110,5 @@ sf plugins
|
|
|
110
110
|
## Commands
|
|
111
111
|
|
|
112
112
|
<!-- commands -->
|
|
113
|
-
* [`sf delta test-classes`](#sf-delta-test-classes)
|
|
114
113
|
|
|
115
|
-
## `sf delta test-classes`
|
|
116
|
-
|
|
117
|
-
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
USAGE
|
|
121
|
-
$ sf delta test-classes -o <value> -c <value> [--json] [-n <value>]
|
|
122
|
-
|
|
123
|
-
FLAGS
|
|
124
|
-
-c, --changed-metadata=<value> (required) Comma seperated list of changed metadata.
|
|
125
|
-
-n, --name=<value> Description of a flag.
|
|
126
|
-
-o, --target-org=<value> (required) The org you want to check the dependencies against.
|
|
127
|
-
|
|
128
|
-
GLOBAL FLAGS
|
|
129
|
-
--json Format output as json.
|
|
130
|
-
|
|
131
|
-
DESCRIPTION
|
|
132
|
-
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API
|
|
133
|
-
|
|
134
|
-
Calculates the tests needed to be ran based on the changed metadata given using the Salesforce Dependency API
|
|
135
|
-
|
|
136
|
-
EXAMPLES
|
|
137
|
-
$ sf delta test-classes
|
|
138
|
-
|
|
139
|
-
FLAG DESCRIPTIONS
|
|
140
|
-
-n, --name=<value> Description of a flag.
|
|
141
|
-
|
|
142
|
-
More information about a flag. Don't repeat the summary.
|
|
143
|
-
```
|
|
144
114
|
<!-- commandsstop -->
|
package/package.json
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
-
import { Config } from '@oclif/core';
|
|
3
|
-
import { DependencyService } from '../../services/dependency-service';
|
|
4
|
-
import { ApexClassService } from '../../services/apex-class-service';
|
|
5
|
-
export type DeltaTestClassesResult = {
|
|
6
|
-
testFiles: string[];
|
|
7
|
-
};
|
|
8
|
-
export default class TestClasses extends SfCommand<DeltaTestClassesResult> {
|
|
9
|
-
static readonly summary: string;
|
|
10
|
-
static readonly description: string;
|
|
11
|
-
static readonly examples: string[];
|
|
12
|
-
static readonly flags: {
|
|
13
|
-
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
-
'target-org': import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
15
|
-
'changed-metadata': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
16
|
-
};
|
|
17
|
-
private dependencyService;
|
|
18
|
-
private apexClassService;
|
|
19
|
-
constructor(argv: string[], config: Config, dependencyService?: DependencyService, apexClassService?: ApexClassService);
|
|
20
|
-
run(): Promise<DeltaTestClassesResult>;
|
|
21
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
4
|
-
const core_1 = require("@salesforce/core");
|
|
5
|
-
const dependency_service_1 = require("../../services/dependency-service");
|
|
6
|
-
const apex_class_service_1 = require("../../services/apex-class-service");
|
|
7
|
-
core_1.Messages.importMessagesDirectory(__dirname);
|
|
8
|
-
const messages = core_1.Messages.loadMessages('sf-delta-tests', 'delta.test-classes');
|
|
9
|
-
class TestClasses extends sf_plugins_core_1.SfCommand {
|
|
10
|
-
constructor(argv, config, dependencyService = new dependency_service_1.DependencyService(), apexClassService = new apex_class_service_1.ApexClassService()) {
|
|
11
|
-
super(argv, config);
|
|
12
|
-
this.dependencyService = dependencyService;
|
|
13
|
-
this.apexClassService = apexClassService;
|
|
14
|
-
}
|
|
15
|
-
async run() {
|
|
16
|
-
const { flags } = await this.parse(TestClasses);
|
|
17
|
-
const org = flags['target-org'];
|
|
18
|
-
const conn = org.getConnection(undefined);
|
|
19
|
-
this.dependencyService.connect(conn);
|
|
20
|
-
const combinedApexClassData = await this.dependencyService.getDependenciesByObjects();
|
|
21
|
-
const changedFiles = flags['changed-metadata'].split(',').map((metadata) => metadata.trim());
|
|
22
|
-
const results = this.dependencyService.getRelatedApexClasses(combinedApexClassData, changedFiles);
|
|
23
|
-
this.debug({ results });
|
|
24
|
-
const testFiles = await this.apexClassService.filterApexTest(results);
|
|
25
|
-
const simpleTestFiles = this.apexClassService.filterApexTestSimple(results);
|
|
26
|
-
this.debug({ testFiles, simpleTestFiles });
|
|
27
|
-
this.log(simpleTestFiles.join(','));
|
|
28
|
-
return {
|
|
29
|
-
testFiles,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
TestClasses.summary = messages.getMessage('summary');
|
|
34
|
-
TestClasses.description = messages.getMessage('description');
|
|
35
|
-
TestClasses.examples = messages.getMessages('examples');
|
|
36
|
-
TestClasses.flags = {
|
|
37
|
-
name: sf_plugins_core_1.Flags.string({
|
|
38
|
-
summary: messages.getMessage('flags.name.summary'),
|
|
39
|
-
description: messages.getMessage('flags.name.description'),
|
|
40
|
-
char: 'n',
|
|
41
|
-
required: false,
|
|
42
|
-
}),
|
|
43
|
-
'target-org': sf_plugins_core_1.Flags.requiredOrg({
|
|
44
|
-
summary: messages.getMessage('flags.target-org.summary'),
|
|
45
|
-
char: 'o',
|
|
46
|
-
required: true,
|
|
47
|
-
}),
|
|
48
|
-
'changed-metadata': sf_plugins_core_1.Flags.string({
|
|
49
|
-
summary: messages.getMessage('flags.changed-metadata.summary'),
|
|
50
|
-
char: 'c',
|
|
51
|
-
required: true,
|
|
52
|
-
}),
|
|
53
|
-
};
|
|
54
|
-
exports.default = TestClasses;
|
|
55
|
-
//# sourceMappingURL=test-classes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-classes.js","sourceRoot":"","sources":["../../../src/commands/delta/test-classes.ts"],"names":[],"mappings":";;AAAA,iEAA+D;AAC/D,2CAA4C;AAE5C,0EAAsE;AACtE,0EAAqE;AAErE,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAAC,YAAY,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;AAM/E,MAAqB,WAAY,SAAQ,2BAAiC;IA2BxE,YACE,IAAc,EACd,MAAc,EACd,iBAAiB,GAAG,IAAI,sCAAiB,EAAE,EAC3C,gBAAgB,GAAG,IAAI,qCAAgB,EAAE;QAEzC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpB,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QAEhD,MAAM,GAAG,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,G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CAAC,wBAAwB,CAAC;QAC1D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,KAAK;KAChB,CAAC;IACF,YAAY,EAAE,uBAAK,CAAC,WAAW,CAAC;QAC9B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;QACxD,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,kBAAkB,EAAE,uBAAK,CAAC,MAAM,CAAC;QAC/B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,gCAAgC,CAAC;QAC9D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;kBAtBiB,WAAW"}
|
package/lib/index.d.ts
DELETED
package/lib/index.js
DELETED
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,iBAAS,EAAE,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApexClassService = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const promises_1 = require("fs/promises");
|
|
6
|
-
const glob_1 = require("glob");
|
|
7
|
-
class ApexClassService {
|
|
8
|
-
// eslint-disable-next-line class-methods-use-this
|
|
9
|
-
filterApexTestSimple(classList) {
|
|
10
|
-
return classList.filter((className) => className.toLowerCase().includes('test'));
|
|
11
|
-
}
|
|
12
|
-
// eslint-disable-next-line class-methods-use-this
|
|
13
|
-
async filterApexTest(classList, rootPath = 'force-app/main/default/classes') {
|
|
14
|
-
// Get all Apex Classes with the filenames `${className}.cls` in the root directory and all subdirectories
|
|
15
|
-
const globPattern = `**/{${classList.join(',')}}.cls`;
|
|
16
|
-
const apexClassPaths = await (0, glob_1.glob)(globPattern, { cwd: rootPath });
|
|
17
|
-
const apexClassTests = [];
|
|
18
|
-
const regexIsTest = /@istest/i;
|
|
19
|
-
// Open each file, check to see if it is a test and add to apexClassTests
|
|
20
|
-
for (const apexClassPath of apexClassPaths) {
|
|
21
|
-
const joinedPath = (0, path_1.join)(rootPath, apexClassPath);
|
|
22
|
-
const parsedPath = (0, path_1.parse)(joinedPath);
|
|
23
|
-
// eslint-disable-next-line no-await-in-loop
|
|
24
|
-
const fileContent = (await (0, promises_1.readFile)(joinedPath)).toString();
|
|
25
|
-
if (fileContent.search(regexIsTest) !== -1) {
|
|
26
|
-
apexClassTests.push(parsedPath.name.replace('.cls', ''));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return apexClassTests;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.ApexClassService = ApexClassService;
|
|
33
|
-
//# sourceMappingURL=apex-class-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apex-class-service.js","sourceRoot":"","sources":["../../src/services/apex-class-service.ts"],"names":[],"mappings":";;;AAAA,+BAA4D;AAC5D,0CAAuC;AACvC,+BAA4B;AAE5B,MAAa,gBAAgB;IAC3B,kDAAkD;IAC3C,oBAAoB,CAAC,SAAmB;QAC7C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,CAAC;IAED,kDAAkD;IAC3C,KAAK,CAAC,cAAc,CAAC,SAAmB,EAAE,QAAQ,GAAG,gCAAgC;QAC1F,0GAA0G;QAC1G,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;QACtD,MAAM,cAAc,GAAG,MAAM,IAAA,WAAI,EAAC,WAAW,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QAElE,MAAM,cAAc,GAAa,EAAE,CAAC;QACpC,MAAM,WAAW,GAAG,UAAU,CAAC;QAE/B,yEAAyE;QACzE,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE;YAC1C,MAAM,UAAU,GAAG,IAAA,WAAQ,EAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YACrD,MAAM,UAAU,GAAG,IAAA,YAAS,EAAC,UAAU,CAAC,CAAC;YACzC,4CAA4C;YAC5C,MAAM,WAAW,GAAG,CAAC,MAAM,IAAA,mBAAQ,EAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YAC5D,IAAI,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC1C,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;aAC1D;SACF;QAED,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AA5BD,4CA4BC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Connection } from '@salesforce/core';
|
|
2
|
-
export type MetadataComponentDependency = {
|
|
3
|
-
MetadataComponentName: string;
|
|
4
|
-
MetadataComponentType: string;
|
|
5
|
-
RefMetadataComponentName: string;
|
|
6
|
-
RefMetadataComponentType: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class DependencyService {
|
|
9
|
-
private connection;
|
|
10
|
-
connect(connection: Connection): void;
|
|
11
|
-
getDependenciesByObjects(additionalObjects?: string[]): Promise<MetadataComponentDependency[]>;
|
|
12
|
-
getRelatedApexClasses(dependencyList: MetadataComponentDependency[], changedMetadata: string[]): string[];
|
|
13
|
-
private isApexClass;
|
|
14
|
-
private getRelations;
|
|
15
|
-
private getDependencyByObject;
|
|
16
|
-
private getDependencySoql;
|
|
17
|
-
private getRefDependencySoql;
|
|
18
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DependencyService = void 0;
|
|
4
|
-
const kit_1 = require("@salesforce/kit");
|
|
5
|
-
class DependencyService {
|
|
6
|
-
connect(connection) {
|
|
7
|
-
this.connection = connection;
|
|
8
|
-
}
|
|
9
|
-
async getDependenciesByObjects(additionalObjects) {
|
|
10
|
-
const objects = new Set([
|
|
11
|
-
'ApexClass',
|
|
12
|
-
'ApexTrigger',
|
|
13
|
-
'CustomObject',
|
|
14
|
-
'Flow',
|
|
15
|
-
'LightningComponentBundle',
|
|
16
|
-
'AuraDefinitionBundle',
|
|
17
|
-
]);
|
|
18
|
-
if (additionalObjects) {
|
|
19
|
-
additionalObjects.forEach((object) => objects.add(object));
|
|
20
|
-
}
|
|
21
|
-
const promises = [];
|
|
22
|
-
objects.forEach((object) => promises.push(this.getDependencyByObject(object)));
|
|
23
|
-
const results = await Promise.all(promises);
|
|
24
|
-
return results.flat();
|
|
25
|
-
}
|
|
26
|
-
getRelatedApexClasses(dependencyList, changedMetadata) {
|
|
27
|
-
const directDependencies = new Set();
|
|
28
|
-
for (const depData of dependencyList) {
|
|
29
|
-
if (changedMetadata.includes(depData.RefMetadataComponentName)) {
|
|
30
|
-
directDependencies.add(depData.MetadataComponentName);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const dependencies = Array.from(this.getRelations(dependencyList, directDependencies));
|
|
34
|
-
return dependencies.filter((dependency) => this.isApexClass(dependencyList, dependency));
|
|
35
|
-
}
|
|
36
|
-
// eslint-disable-next-line class-methods-use-this
|
|
37
|
-
isApexClass(dependencyList, dependency) {
|
|
38
|
-
for (const metadata of dependencyList) {
|
|
39
|
-
if ((metadata.MetadataComponentType === 'ApexClass' && metadata.MetadataComponentName === dependency) ||
|
|
40
|
-
(metadata.RefMetadataComponentType === 'ApexClass' && metadata.RefMetadataComponentName === dependency)) {
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
getRelations(dependencyList, dependencies) {
|
|
47
|
-
const newDependencies = new Set(dependencies);
|
|
48
|
-
for (const depData of dependencyList) {
|
|
49
|
-
if (newDependencies.has(depData.RefMetadataComponentName)) {
|
|
50
|
-
newDependencies.add(depData.MetadataComponentName);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (newDependencies.size !== dependencies.size) {
|
|
54
|
-
return this.getRelations(dependencyList, newDependencies);
|
|
55
|
-
}
|
|
56
|
-
return newDependencies;
|
|
57
|
-
}
|
|
58
|
-
async getDependencyByObject(objectType) {
|
|
59
|
-
if (!this.connection) {
|
|
60
|
-
throw Error('Run connection() first');
|
|
61
|
-
}
|
|
62
|
-
const dependencies = await this.connection.tooling.query(this.getDependencySoql(objectType));
|
|
63
|
-
const refDependencies = await this.connection.tooling.query(this.getRefDependencySoql(objectType));
|
|
64
|
-
return (0, kit_1.sortBy)([...dependencies.records, ...refDependencies.records], ['MetadataComponentType', 'RefMetadataComponentType']);
|
|
65
|
-
}
|
|
66
|
-
// eslint-disable-next-line class-methods-use-this
|
|
67
|
-
getDependencySoql(objectType) {
|
|
68
|
-
return `SELECT MetadataComponentName, MetadataComponentType, RefMetadataComponentName, RefMetadataComponentType
|
|
69
|
-
FROM MetadataComponentDependency
|
|
70
|
-
WHERE MetadataComponentType = '${objectType}'
|
|
71
|
-
AND MetadataComponentNamespace = NULL
|
|
72
|
-
AND RefMetadataComponentNamespace = NULL`;
|
|
73
|
-
}
|
|
74
|
-
// eslint-disable-next-line class-methods-use-this
|
|
75
|
-
getRefDependencySoql(objectType) {
|
|
76
|
-
return `SELECT MetadataComponentName, MetadataComponentType, RefMetadataComponentName, RefMetadataComponentType
|
|
77
|
-
FROM MetadataComponentDependency
|
|
78
|
-
WHERE RefMetadataComponentType = '${objectType}'
|
|
79
|
-
AND MetadataComponentNamespace = NULL
|
|
80
|
-
AND RefMetadataComponentNamespace = NULL`;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.DependencyService = DependencyService;
|
|
84
|
-
//# sourceMappingURL=dependency-service.js.map
|
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AM,eAAe,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CACzD,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,CACtC,CAAC;QAEF,OAAO,IAAA,YAAM,EACX,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,EACrD,CAAC,uBAAuB,EAAE,0BAA0B,CAAC,CACtD,CAAC;IACJ,CAAC;IAED,kDAAkD;IAC1C,iBAAiB,CAAC,UAAkB;QAC1C,OAAO;;uCAE4B,UAAU;;iDAEA,CAAC;IAChD,CAAC;IAED,kDAAkD;IAC1C,oBAAoB,CAAC,UAAkB;QAC7C,OAAO;;0CAE+B,UAAU;;iDAEH,CAAC;IAChD,CAAC;CACF;AAtGD,8CAsGC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// import { TestContext } from '@salesforce/core/lib/testSetup';
|
|
4
|
-
// import { expect } from 'chai';
|
|
5
|
-
// import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
|
|
6
|
-
// import World from '../../../src/commands/hello/world';
|
|
7
|
-
const fs_1 = require("fs");
|
|
8
|
-
const mocha_1 = require("mocha");
|
|
9
|
-
const chai_1 = require("chai");
|
|
10
|
-
const dependency_service_1 = require("./dependency-service");
|
|
11
|
-
describe('dependency-services', () => {
|
|
12
|
-
let dependencyService;
|
|
13
|
-
let dependencyList;
|
|
14
|
-
before(() => {
|
|
15
|
-
dependencyList = JSON.parse((0, fs_1.readFileSync)('test/fixtures/dependency-exploration-sf.json').toString());
|
|
16
|
-
});
|
|
17
|
-
(0, mocha_1.beforeEach)(() => {
|
|
18
|
-
dependencyService = new dependency_service_1.DependencyService();
|
|
19
|
-
});
|
|
20
|
-
describe('getRelatedApexClasses', () => {
|
|
21
|
-
it('test', () => {
|
|
22
|
-
const results = dependencyService.getRelatedApexClasses(dependencyList, ['APIUsers']);
|
|
23
|
-
(0, chai_1.expect)(results).to.deep.eq(['APIUsersTest']);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
//# sourceMappingURL=dependency-services.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-services.test.js","sourceRoot":"","sources":["../../src/services/dependency-services.test.ts"],"names":[],"mappings":";;AAAA,gEAAgE;AAChE,iCAAiC;AACjC,iEAAiE;AACjE,yDAAyD;AACzD,2BAAkC;AAClC,iCAAmC;AACnC,+BAA8B;AAC9B,6DAAsF;AAEtF,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,IAAI,iBAAoC,CAAC;IACzC,IAAI,cAA6C,CAAC;IAElD,MAAM,CAAC,GAAG,EAAE;QACV,cAAc,GAAG,IAAI,CAAC,KAAK,CACzB,IAAA,iBAAY,EAAC,8CAA8C,CAAC,CAAC,QAAQ,EAAE,CACvC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,IAAA,kBAAU,EAAC,GAAG,EAAE;QACd,iBAAiB,GAAG,IAAI,sCAAiB,EAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACd,MAAM,OAAO,GAAG,iBAAiB,CAAC,qBAAqB,CAAC,cAAc,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;YACtF,IAAA,aAAM,EAAC,OAAO,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|