@sprucelabs/jest-sheets-reporter 1.3.122 → 1.3.124
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
CHANGED
|
@@ -14,7 +14,9 @@ npm install --dev @sprucelabs/jest-sheets-reporter
|
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Example Jest config
|
|
17
|
+
Inside your `package.json` there is a `jest` block.
|
|
17
18
|
|
|
19
|
+
Add the following configuration:
|
|
18
20
|
```json
|
|
19
21
|
"jest": {
|
|
20
22
|
"reporters": [
|
|
@@ -23,7 +25,7 @@ npm install --dev @sprucelabs/jest-sheets-reporter
|
|
|
23
25
|
"@sprucelabs/jest-sheets-reporter",
|
|
24
26
|
{
|
|
25
27
|
"sheetId": "{{spreadsheetId}}",
|
|
26
|
-
"worksheetId":
|
|
28
|
+
"worksheetId": 0,
|
|
27
29
|
"testMap": {
|
|
28
30
|
"testName": "destinationCell",
|
|
29
31
|
"getsGoodHealthCheckAndNothingElse": "C5",
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
+
if (mod && mod.__esModule) return mod;
|
|
26
|
+
var result = {};
|
|
27
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
+
__setModuleDefault(result, mod);
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
32
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
const test_1 = __importStar(require("@sprucelabs/test"));
|
|
36
|
+
const GoogleAdapter_1 = __importDefault(require("../../adapters/GoogleAdapter"));
|
|
37
|
+
class GoogleAdapterTest extends test_1.default {
|
|
38
|
+
static async badKeyThrowsErrorWithLinkToDocs() {
|
|
39
|
+
const adapter = new GoogleAdapter_1.default({
|
|
40
|
+
privateKey: '234',
|
|
41
|
+
serviceEmail: 'test@test.com',
|
|
42
|
+
});
|
|
43
|
+
await test_1.assert.doesThrowAsync(() => adapter.updateCell({
|
|
44
|
+
cell: 'B1',
|
|
45
|
+
sheetId: '12345',
|
|
46
|
+
worksheetId: 0,
|
|
47
|
+
value: '100',
|
|
48
|
+
}), 'https://theoephraim.github.io/node-google-spreadsheet/#/getting-started/authentication');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, test_1.test)()
|
|
53
|
+
], GoogleAdapterTest, "badKeyThrowsErrorWithLinkToDocs", null);
|
|
54
|
+
exports.default = GoogleAdapterTest;
|
|
@@ -43,10 +43,17 @@ class SheetsReporterGoogleAdapter {
|
|
|
43
43
|
resolve();
|
|
44
44
|
}
|
|
45
45
|
catch (err) {
|
|
46
|
-
|
|
46
|
+
const isBadKey = err.reason === 'no start line';
|
|
47
|
+
if (isBadKey) {
|
|
48
|
+
reject(new Error(`Bad private key! Checkout this for next steps:\n\nhttps://theoephraim.github.io/node-google-spreadsheet/#/getting-started/authentication`));
|
|
47
49
|
return;
|
|
48
50
|
}
|
|
49
|
-
|
|
51
|
+
if (operation.retry(err) && isBadKey) {
|
|
52
|
+
console.error('Sheets reporter error', err);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const error = operation.mainError();
|
|
56
|
+
reject(error);
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
59
|
}
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@sprucelabs/resolve-path-aliases"
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
|
-
"version": "1.3.
|
|
16
|
+
"version": "1.3.124",
|
|
17
17
|
"main": "./build/SheetsReporter.js",
|
|
18
18
|
"types": "./build/SheetsReporter.d.ts",
|
|
19
19
|
"description": "Have your Jest tests update a Google Spreadsheet™®©. 📡",
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@sprucelabs/resolve-path-aliases": "^1.0.244",
|
|
65
65
|
"@sprucelabs/semantic-release": "^4.0.8",
|
|
66
|
-
"@sprucelabs/test": "^7.7.
|
|
66
|
+
"@sprucelabs/test": "^7.7.371",
|
|
67
67
|
"@types/google-spreadsheet": "^3.3.0",
|
|
68
68
|
"@types/node": "^18.8.3",
|
|
69
69
|
"chokidar-cli": "^3.0.0",
|
|
70
70
|
"concurrently": "^7.4.0",
|
|
71
|
-
"eslint": "^8.
|
|
71
|
+
"eslint": "^8.25.0",
|
|
72
72
|
"eslint-config-spruce": "^10.11.4",
|
|
73
73
|
"jest": "^29.1.2",
|
|
74
74
|
"jest-reporters": "^0.0.2",
|