Skip to content

Commit fec3522

Browse files
authored
Unit Testing and polish (#94)
* Move source code into `src` directory * Write various unit tests to cover core logic * Add test and push scripts * Handle non 200 responses within paginated results * Validate JWT `aud` claim * Bump version * Skip any falsey value other than `false` for optional params
1 parent 428e059 commit fec3522

File tree

16 files changed

+9452
-1139
lines changed

16 files changed

+9452
-1139
lines changed

src/parser/shard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: GESI
22

3-
version: 9.0.0
3+
version: 9.1.0
44

55
crystal: '>=0.34.0'
66

src/script/.clasp.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{"scriptId":"1KjnRVVFr2KiHH55sqBfHcZ-yXweJ7iv89V99ubaLy4A7B_YH8rB5u0s3"}
1+
{
2+
"scriptId":"1KjnRVVFr2KiHH55sqBfHcZ-yXweJ7iv89V99ubaLy4A7B_YH8rB5u0s3",
3+
"rootDir": "./src"
4+
}

src/script/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16.13

src/script/package-lock.json

Lines changed: 7937 additions & 1075 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/script/package.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
22
"name": "gesi",
3-
"version": "9.0.0",
3+
"version": "9.1.0",
44
"description": "Google Sheets ESI Add-on",
5-
"scripts": {},
5+
"scripts": {
6+
"test": "jest",
7+
"push": "sed -E -e '/^(export|import)/ s|^/*|//|' -i src/*.ts && clasp push && sed -E -e '/^(\\/\\/export|\\/\\/import)/ s|^/*||' -i src/*.ts"
8+
},
69
"repository": {
710
"type": "git",
811
"url": "git+https://github.com/Blacksmoke16/GESI.git"
@@ -23,6 +26,25 @@
2326
"devDependencies": {
2427
"@google/clasp": "2.4.*",
2528
"@types/google-apps-script-oauth2": "38.0.0",
26-
"typescript": "4.*"
29+
"@types/jest": "^27.4.1",
30+
"jest": "^27.5.1",
31+
"jest-ts-auto-mock": "^2.1.0",
32+
"ts-auto-mock": "^3.5.0",
33+
"ts-jest": "^27.1.4",
34+
"ttypescript": "^1.5.13",
35+
"typescript": "^4.6.3"
36+
},
37+
"jest": {
38+
"preset": "ts-jest",
39+
"testEnvironment": "node",
40+
"verbose": false,
41+
"setupFiles": [
42+
"./spec/index.ts"
43+
],
44+
"globals": {
45+
"ts-jest": {
46+
"compiler": "ttypescript"
47+
}
48+
}
2749
}
2850
}

0 commit comments

Comments
 (0)