@hestia-earth/data-api 0.1.6 → 0.1.8
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/jest.env.ts +2 -0
- package/jest.setup.ts +26 -0
- package/package.json +15 -16
package/jest.env.ts
ADDED
package/jest.setup.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { quit } from './src/cache';
|
|
2
|
+
|
|
3
|
+
let endPool: () => Promise<void>;
|
|
4
|
+
let initPool: () => void;
|
|
5
|
+
|
|
6
|
+
beforeAll(() => {
|
|
7
|
+
const db = require('./database/');
|
|
8
|
+
endPool = db.endPool;
|
|
9
|
+
initPool = db.initPool;
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
initPool();
|
|
14
|
+
// Clear redis cache
|
|
15
|
+
const { cache } = require('./src/cache');
|
|
16
|
+
if (cache && cache.del) {
|
|
17
|
+
cache.del('*', () => {});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterAll(async () => {
|
|
22
|
+
if (endPool) {
|
|
23
|
+
await endPool();
|
|
24
|
+
}
|
|
25
|
+
await quit();
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/data-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Hestia Data API definitions",
|
|
5
5
|
"main": "dist/models.js",
|
|
6
6
|
"typings": "dist/models.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dev": "ts-node-dev --respawn --rs dev.ts --files --ignore-watch node_modules",
|
|
13
13
|
"lint": "tsc --noEmit && eslint .",
|
|
14
14
|
"lint:fix": "npm run lint -- --fix",
|
|
15
|
-
"test": "
|
|
15
|
+
"test": "jest --runInBand --forceExit",
|
|
16
16
|
"migrate": "ts-node scripts/run-migrations.ts",
|
|
17
17
|
"seed": "ts-node scripts/run-seed.ts",
|
|
18
18
|
"listdb": "ts-node scripts/list-databases.ts",
|
|
@@ -37,43 +37,41 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://gitlab.com/hestia-earth/hestia-data-api#readme",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@hestia-earth/schema": ">=
|
|
40
|
+
"@hestia-earth/schema": ">=35.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@babel/preset-env": "^7.29.0",
|
|
44
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
43
45
|
"@commitlint/cli": "^17.6.5",
|
|
44
46
|
"@commitlint/config-conventional": "^17.6.5",
|
|
45
47
|
"@elastic/elasticsearch": "^7.13.0",
|
|
46
48
|
"@hestia-earth/api": "^0.25.20",
|
|
47
49
|
"@hestia-earth/eslint-config": "^0.1.0",
|
|
48
|
-
"@hestia-earth/pipeline-utils": "^0.
|
|
50
|
+
"@hestia-earth/pipeline-utils": "^0.16.9",
|
|
49
51
|
"@hestia-earth/utils": "^0.16.11",
|
|
50
52
|
"@sentry/node": "^7.51.2",
|
|
51
53
|
"@sentry/serverless": "^7.55.2",
|
|
52
54
|
"@sentry/tracing": "^7.51.2",
|
|
53
55
|
"@slack/web-api": "^6.8.1",
|
|
54
56
|
"@types/aws-lambda": "^8.10.149",
|
|
55
|
-
"@types/chai": "^4.3.5",
|
|
56
|
-
"@types/chai-as-promised": "^7.1.5",
|
|
57
57
|
"@types/compression": "^1.7.2",
|
|
58
58
|
"@types/cors": "^2.8.13",
|
|
59
59
|
"@types/express": "^4.17.6",
|
|
60
|
+
"@types/jest": "^30.0.0",
|
|
60
61
|
"@types/lodash.chunk": "^4.2.7",
|
|
61
62
|
"@types/lodash.isequal": "^4.5.8",
|
|
62
63
|
"@types/lodash.omit": "^4.5.9",
|
|
63
64
|
"@types/lodash.pick": "^4.4.9",
|
|
64
65
|
"@types/lodash.uniqby": "^4.7.7",
|
|
65
|
-
"@types/mocha": "^10.0.10",
|
|
66
66
|
"@types/morgan": "^1.9.4",
|
|
67
67
|
"@types/node-cleanup": "^2.1.2",
|
|
68
68
|
"@types/pg": "^8.10.1",
|
|
69
|
-
"@types/sinon": "^10.0.15",
|
|
70
69
|
"@types/supertest": "^2.0.12",
|
|
71
70
|
"@types/swagger-jsdoc": "^6.0.1",
|
|
72
71
|
"@types/swagger-ui-express": "^4.1.3",
|
|
72
|
+
"babel-jest": "^30.2.0",
|
|
73
73
|
"bson": "^4.7.2",
|
|
74
74
|
"camelcase": "^8.0.0",
|
|
75
|
-
"chai": "^4.3.7",
|
|
76
|
-
"chai-as-promised": "^7.1.1",
|
|
77
75
|
"compression": "^1.7.4",
|
|
78
76
|
"cors": "^2.8.5",
|
|
79
77
|
"csvtojson": "^2.0.10",
|
|
@@ -85,29 +83,27 @@
|
|
|
85
83
|
"express-redis-cache": "^1.1.3",
|
|
86
84
|
"http2-express-bridge": "^1.0.7",
|
|
87
85
|
"husky": "^4.3.8",
|
|
86
|
+
"jest": "^30.2.0",
|
|
88
87
|
"lodash.chunk": "^4.2.0",
|
|
89
88
|
"lodash.isequal": "^4.5.0",
|
|
90
89
|
"lodash.omit": "^4.5.0",
|
|
91
90
|
"lodash.pick": "^4.2.0",
|
|
92
91
|
"lodash.uniqby": "^4.7.0",
|
|
93
92
|
"map-obj": "^5.0.2",
|
|
94
|
-
"mocha": "^10.2.0",
|
|
95
93
|
"mongodb": "^3.7.4",
|
|
96
94
|
"morgan": "^1.10.0",
|
|
97
|
-
"nyc": "^15.1.0",
|
|
98
95
|
"pg": "^8.11.0",
|
|
99
96
|
"postgrator": "^7.1.1",
|
|
100
97
|
"prettier": "^3.0.3",
|
|
101
98
|
"redis": "^3.1.2",
|
|
102
|
-
"rxjs": "^
|
|
99
|
+
"rxjs": "^7.8.2",
|
|
103
100
|
"serverless": "^3.32.2",
|
|
104
101
|
"serverless-deployment-bucket": "^1.6.0",
|
|
105
|
-
"serverless-offline": "^12.0.4",
|
|
106
|
-
"sinon": "^15.1.0",
|
|
107
102
|
"standard-version": "^9.5.0",
|
|
108
103
|
"supertest": "^6.3.3",
|
|
109
104
|
"swagger-jsdoc": "^6.2.8",
|
|
110
105
|
"swagger-ui-express": "^4.6.3",
|
|
106
|
+
"ts-jest": "^29.4.6",
|
|
111
107
|
"ts-node": "^10.9.1",
|
|
112
108
|
"ts-node-dev": "^2.0.0",
|
|
113
109
|
"typescript": "^5.1.6",
|
|
@@ -118,5 +114,8 @@
|
|
|
118
114
|
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
119
115
|
}
|
|
120
116
|
},
|
|
121
|
-
"prettier": "@hestia-earth/eslint-config/prettier.json"
|
|
117
|
+
"prettier": "@hestia-earth/eslint-config/prettier.json",
|
|
118
|
+
"engines": {
|
|
119
|
+
"node": ">=22.0.0"
|
|
120
|
+
}
|
|
122
121
|
}
|