@sprucelabs/jest-sheets-reporter 1.3.124 → 2.0.0
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.
|
@@ -26,7 +26,7 @@ class SheetsReporterUtility {
|
|
|
26
26
|
static resolveAdapterPath(adapterFilepath) {
|
|
27
27
|
const filePath = adapterFilepath !== null && adapterFilepath !== void 0 ? adapterFilepath : process.env.SHEETS_REPORTER_ADAPTER;
|
|
28
28
|
if (!filePath) {
|
|
29
|
-
throw new Error(`SheetsReporter has no adapter set, try adding SHEETS_REPORTER_ADAPTER="
|
|
29
|
+
throw new Error(`SheetsReporter has no adapter set, try adding SHEETS_REPORTER_ADAPTER="DummyAdapter" or SHEETS_REPORTER_ADAPTER="GoogleAdapter" to your env.`);
|
|
30
30
|
}
|
|
31
31
|
const basePath = filePath.search(new RegExp(path_1.default.sep)) > -1
|
|
32
32
|
? process.cwd()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import SheetsReporterTestAdapter from './TestAdapter';
|
|
2
|
-
export default class
|
|
2
|
+
export default class SheetsReporterDummyAdapter extends SheetsReporterTestAdapter {
|
|
3
3
|
private static cellCache;
|
|
4
4
|
constructor();
|
|
5
5
|
updateCell(options: {
|
|
@@ -4,22 +4,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const TestAdapter_1 = __importDefault(require("./TestAdapter"));
|
|
7
|
-
class
|
|
7
|
+
class SheetsReporterDummyAdapter extends TestAdapter_1.default {
|
|
8
8
|
constructor() {
|
|
9
9
|
super({ serviceEmail: 'not-needed@nothing.com', privateKey: 'nothing' });
|
|
10
10
|
}
|
|
11
11
|
async updateCell(options) {
|
|
12
12
|
const key = `${options.sheetId}${options.worksheetId}${options.cell}`;
|
|
13
|
-
|
|
13
|
+
SheetsReporterDummyAdapter.cellCache[key] = options.value;
|
|
14
14
|
}
|
|
15
15
|
async fetchCellValue(sheetId, worksheetId, cell) {
|
|
16
16
|
const key = `${sheetId}${worksheetId}${cell}`;
|
|
17
|
-
return
|
|
17
|
+
return SheetsReporterDummyAdapter.cellCache[key];
|
|
18
18
|
}
|
|
19
19
|
async createRandomWorksheet() {
|
|
20
20
|
return -1;
|
|
21
21
|
}
|
|
22
22
|
async deleteWorksheet() { }
|
|
23
23
|
}
|
|
24
|
-
exports.default =
|
|
25
|
-
|
|
24
|
+
exports.default = SheetsReporterDummyAdapter;
|
|
25
|
+
SheetsReporterDummyAdapter.cellCache = {};
|
package/package.json
CHANGED