@salesforce/source-testkit 1.2.2 → 1.2.5

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,24 @@
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
+ ### [1.2.5](https://github.com/salesforcecli/source-testkit/compare/v1.2.4...v1.2.5) (2022-06-22)
6
+
7
+ ### Bug Fixes
8
+
9
+ - yarn deduplicate for fewer jsforces ([b535295](https://github.com/salesforcecli/source-testkit/commit/b5352951cc3a39a6dc9cbc4a92a04c2669e30b03))
10
+
11
+ ### [1.2.4](https://github.com/salesforcecli/source-testkit/compare/v1.2.3...v1.2.4) (2022-06-22)
12
+
13
+ ### Bug Fixes
14
+
15
+ - bump core for jsforce ([c76f41a](https://github.com/salesforcecli/source-testkit/commit/c76f41aa8ca9ff60ed55f950d0aab0656f8a296f))
16
+
17
+ ### [1.2.3](https://github.com/salesforcecli/source-testkit/compare/v1.2.2...v1.2.3) (2022-06-22)
18
+
19
+ ### Bug Fixes
20
+
21
+ - bump lib versions ([#82](https://github.com/salesforcecli/source-testkit/issues/82)) ([40f90d6](https://github.com/salesforcecli/source-testkit/commit/40f90d6b8e3e47a7c172dd01a8fa43cf96e89ab4))
22
+
5
23
  ### [1.2.2](https://github.com/salesforcecli/source-testkit/compare/v1.2.1...v1.2.2) (2022-06-18)
6
24
 
7
25
  ### Bug Fixes
package/lib/assertions.js CHANGED
@@ -15,7 +15,6 @@ const fg = require("fast-glob");
15
15
  const source_deploy_retrieve_1 = require("@salesforce/source-deploy-retrieve");
16
16
  const debug_1 = require("debug");
17
17
  const fileTracker_1 = require("./fileTracker");
18
- const autoFetchQuery_1 = require("./autoFetchQuery");
19
18
  (0, chai_1.use)(chaiEach);
20
19
  /**
21
20
  * Assertions is a class that is designed to encapsulate common assertions we want to
@@ -335,8 +334,9 @@ class Assertions {
335
334
  (0, chai_1.expect)(someAreNotUpdated, 'expect some SourceMembers to not be updated').to.be.true;
336
335
  }
337
336
  async retrieveSourceMembers(globs, ignore = []) {
337
+ var _a;
338
338
  const query = 'SELECT Id,MemberName,MemberType,RevisionCounter FROM SourceMember';
339
- const result = this.connection ? await (0, autoFetchQuery_1.autoFetchQuery)(query, this.connection, true) : undefined;
339
+ const result = await ((_a = this.connection) === null || _a === void 0 ? void 0 : _a.tooling.query(query, { autoFetch: true, maxFetch: 50000 }));
340
340
  const all = await this.doGlob(globs);
341
341
  const ignoreFiles = await this.doGlob(ignore, false);
342
342
  const toTrack = all.filter((file) => !ignoreFiles.includes(file));
@@ -362,13 +362,15 @@ class Assertions {
362
362
  });
363
363
  }
364
364
  async retrieveApexTestResults() {
365
+ var _a;
365
366
  const query = 'SELECT TestTimestamp, ApexClassId FROM ApexTestResult';
366
- const result = this.connection ? await (0, autoFetchQuery_1.autoFetchQuery)(query, this.connection, true) : undefined;
367
+ const result = await ((_a = this.connection) === null || _a === void 0 ? void 0 : _a.tooling.query(query, { autoFetch: true, maxFetch: 50000 }));
367
368
  return (result === null || result === void 0 ? void 0 : result.records) || [];
368
369
  }
369
370
  async retrieveApexClasses(classNames) {
371
+ var _a;
370
372
  const query = 'SELECT Name,Id FROM ApexClass';
371
- const result = this.connection ? await (0, autoFetchQuery_1.autoFetchQuery)(query, this.connection, true) : undefined;
373
+ const result = await ((_a = this.connection) === null || _a === void 0 ? void 0 : _a.tooling.query(query, { autoFetch: true, maxFetch: 50000 }));
372
374
  const records = (result === null || result === void 0 ? void 0 : result.records) || [];
373
375
  return classNames ? records.filter((r) => classNames.includes(r.Name)) : records;
374
376
  }
@@ -8,7 +8,6 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.ExecutionLog = void 0;
10
10
  const ts_types_1 = require("@salesforce/ts-types");
11
- const autoFetchQuery_1 = require("./autoFetchQuery");
12
11
  /**
13
12
  * This class maintains a map of command execution history.
14
13
  *
@@ -50,10 +49,12 @@ class ExecutionLog {
50
49
  return sorted[0];
51
50
  }
52
51
  async querySourceMembers() {
52
+ var _a;
53
53
  const query = 'SELECT Id,MemberName,MemberType,RevisionCounter FROM SourceMember';
54
- const result = this.context.connection
55
- ? await (0, autoFetchQuery_1.autoFetchQuery)(query, this.context.connection, true)
56
- : undefined;
54
+ const result = await ((_a = this.context.connection) === null || _a === void 0 ? void 0 : _a.tooling.query(query, {
55
+ autoFetch: true,
56
+ maxFetch: 50000,
57
+ }));
57
58
  return (result === null || result === void 0 ? void 0 : result.records) || [];
58
59
  }
59
60
  }
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": "1.2.2",
4
+ "version": "1.2.5",
5
5
  "author": "Salesforce",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "lib/index.js",
@@ -30,10 +30,10 @@
30
30
  "!lib/**/*.map"
31
31
  ],
32
32
  "dependencies": {
33
- "@salesforce/cli-plugins-testkit": "^2.2.0",
34
- "@salesforce/core": "^3.20.1",
33
+ "@salesforce/cli-plugins-testkit": "^2.3.0",
34
+ "@salesforce/core": "^3.21.3",
35
35
  "@salesforce/kit": "^1.5.42",
36
- "@salesforce/source-deploy-retrieve": "^6.0.2",
36
+ "@salesforce/source-deploy-retrieve": "^6.1.0",
37
37
  "@salesforce/ts-types": "^1.5.20",
38
38
  "archiver": "^5.2.0",
39
39
  "chai-each": "^0.0.1",
@@ -1,3 +0,0 @@
1
- import { Connection } from '@salesforce/core';
2
- import { QueryResult } from 'jsforce';
3
- export declare const autoFetchQuery: <T>(query: string, conn: Connection, useTooling?: boolean, maxFetch?: number) => Promise<QueryResult<T>>;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2020, salesforce.com, inc.
4
- * All rights reserved.
5
- * Licensed under the BSD 3-Clause license.
6
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.autoFetchQuery = void 0;
10
- const autoFetchQuery = async (query, conn, useTooling = false, maxFetch = 50000) => {
11
- return new Promise((resolve, reject) => {
12
- const records = [];
13
- const res = (useTooling ? conn.tooling : conn)
14
- .query(query)
15
- .on('record', (rec) => records.push(rec))
16
- .on('error', (err) => reject(err))
17
- .on('end', () => {
18
- var _a;
19
- resolve({
20
- done: true,
21
- totalSize: (_a = res.totalSize) !== null && _a !== void 0 ? _a : 0,
22
- records,
23
- });
24
- })
25
- .run({ autoFetch: true, maxFetch });
26
- });
27
- };
28
- exports.autoFetchQuery = autoFetchQuery;
29
- //# sourceMappingURL=autoFetchQuery.js.map