@sprucelabs/jest-sheets-reporter 3.0.204 → 3.0.206
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
|
@@ -67,6 +67,8 @@ Then we set the background and the text color based on the value being exactly `
|
|
|
67
67
|
5. Find sheets and enable it.
|
|
68
68
|
6. After save, click "Create Credentials" in the upper right.
|
|
69
69
|
7. Give it a name, leave everything else blank and save
|
|
70
|
+
8. After save, click "Credentials" in the left menu
|
|
71
|
+
8. Then click on your service account's name
|
|
70
72
|
9. On the service account details page, click "KEYS" tab
|
|
71
73
|
10. Click Add Key -> JSON
|
|
72
74
|
11. Take the download private key and open it
|
|
@@ -31,7 +31,13 @@ class SheetsAdapterTest extends AbstractSheetsReporterTest_1.default {
|
|
|
31
31
|
}
|
|
32
32
|
static async afterAll() {
|
|
33
33
|
await super.afterAll();
|
|
34
|
-
await this.sheetsAdapter.
|
|
34
|
+
const worksheets = await this.sheetsAdapter.fetchAllWorksheets(this.sheetId);
|
|
35
|
+
worksheets.pop();
|
|
36
|
+
for (const worksheet of worksheets) {
|
|
37
|
+
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
38
|
+
this.log('deleting worksheet', worksheet.sheetId, worksheet.title);
|
|
39
|
+
await this.sheetsAdapter.deleteWorksheet(this.sheetId, parseInt(worksheet.sheetId, 10));
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
42
|
static async canUpdateCell(expected) {
|
|
37
43
|
const sheetId = this.sheetId;
|
|
@@ -18,4 +18,5 @@ export default class SheetsReporterGoogleAdapter implements IGoogleSheetsAdapter
|
|
|
18
18
|
}>;
|
|
19
19
|
protected fetchSpreadsheet(sheetId: string): Promise<GoogleSpreadsheet>;
|
|
20
20
|
protected uncachedFetchSpreadsheet(sheetId: string): Promise<GoogleSpreadsheet>;
|
|
21
|
+
fetchAllWorksheets(sheetId: string): Promise<import("google-spreadsheet").GoogleSpreadsheetWorksheet[]>;
|
|
21
22
|
}
|
|
@@ -86,5 +86,9 @@ class SheetsReporterGoogleAdapter {
|
|
|
86
86
|
await doc.loadInfo();
|
|
87
87
|
return doc;
|
|
88
88
|
}
|
|
89
|
+
async fetchAllWorksheets(sheetId) {
|
|
90
|
+
const spreadsheet = await this.fetchSpreadsheet(sheetId);
|
|
91
|
+
return Object.values(spreadsheet.sheetsById);
|
|
92
|
+
}
|
|
89
93
|
}
|
|
90
94
|
exports.default = SheetsReporterGoogleAdapter;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@types/google-spreadsheet"
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
|
-
"version": "3.0.
|
|
18
|
+
"version": "3.0.206",
|
|
19
19
|
"main": "./build/SheetsReporter.js",
|
|
20
20
|
"types": "./build/SheetsReporter.d.ts",
|
|
21
21
|
"description": "Have your Jest tests update a Google Spreadsheet™®©. 📡",
|
|
@@ -59,18 +59,18 @@
|
|
|
59
59
|
"retry": "^0.13.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@sprucelabs/resolve-path-aliases": "^2.0.
|
|
62
|
+
"@sprucelabs/resolve-path-aliases": "^2.0.530",
|
|
63
63
|
"@sprucelabs/semantic-release": "^5.0.2",
|
|
64
|
-
"@sprucelabs/test": "^9.0.
|
|
64
|
+
"@sprucelabs/test": "^9.0.70",
|
|
65
65
|
"@types/google-spreadsheet": "^3.3.2",
|
|
66
66
|
"@types/node": "^22.13.1",
|
|
67
67
|
"@types/retry": "^0.12.5",
|
|
68
68
|
"chokidar-cli": "^3.0.0",
|
|
69
|
-
"eslint": "^9.
|
|
69
|
+
"eslint": "^9.20.1",
|
|
70
70
|
"eslint-config-spruce": "^11.2.26",
|
|
71
71
|
"jest": "^29.7.0",
|
|
72
72
|
"jest-reporters": "^0.0.2",
|
|
73
|
-
"prettier": "^3.
|
|
73
|
+
"prettier": "^3.5.0",
|
|
74
74
|
"ts-node": "^10.9.2",
|
|
75
75
|
"tsc-watch": "^6.2.1",
|
|
76
76
|
"tsconfig-paths": "^4.2.0",
|