Skip to content

Commit b85667a

Browse files
authored
Merge pull request #512 from sam1el/chore/testing
Chore/testing
2 parents 0e5b7f5 + ba301b1 commit b85667a

File tree

9 files changed

+161
-200
lines changed

9 files changed

+161
-200
lines changed

.circleci/config.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ main_only: &main_only
1414
only: master
1515

1616
defaults: &defaults
17-
resource_class: small
17+
resource_class: medium
1818
docker:
1919
- image: cimg/node:22.20.0
2020

@@ -87,27 +87,54 @@ jobs:
8787

8888
build-test-monitor:
8989
<<: *defaults
90+
parallelism: 2
9091
steps:
9192
- checkout
93+
- restore_cache:
94+
keys:
95+
- v1-deps-{{ checksum "package-lock.json" }}
9296
- run: npm install
97+
- save_cache:
98+
paths:
99+
- node_modules
100+
- ~/.cache/jest
101+
key: v1-deps-{{ checksum "package-lock.json" }}
93102
- run: npm test
94103
- run: npx semantic-release
95104
- notify_slack_on_failure
96105

97106
build-test:
98107
<<: *defaults
108+
parallelism: 2
99109
steps:
100110
- checkout
111+
- restore_cache:
112+
keys:
113+
- v1-deps-{{ checksum "package-lock.json" }}
101114
- run: npm install
115+
- save_cache:
116+
paths:
117+
- node_modules
118+
- ~/.cache/jest
119+
key: v1-deps-{{ checksum "package-lock.json" }}
102120
- run: npm test
103121
- run: npm run pkg-binaries:linux
104122
- run: ./snyk-api-import-linux help
105123

106124
build-test-from-fork:
107125
<<: *defaults
126+
parallelism: 2
108127
steps:
109128
- checkout
129+
- restore_cache:
130+
keys:
131+
- v1-deps-{{ checksum "package-lock.json" }}
110132
- run: npm install
133+
- save_cache:
134+
paths:
135+
- node_modules
136+
- ~/.cache/jest
137+
key: v1-deps-{{ checksum "package-lock.json" }}
111138
- run: npm test
112139

113140
workflows:

.gitleaks.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[[allowlists]]
2+
description = "Allow specific paths"
3+
paths = [
4+
'''test/''',
5+
'''readme.md''',
6+
'''gitleaks.toml''',
7+
'''docs/''',
8+
]

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
**/fixtures
33
**/research/
44

5+
/test/

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-env'],
3+
};

jest.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
module.exports = {
2-
preset: 'ts-jest',
32
testEnvironment: 'node',
3+
extensionsToTreatAsEsm: ['.ts'],
44
collectCoverageFrom: ['lib/**/*.ts'],
55
coverageReporters: ['text-summary', 'html'],
6+
transformIgnorePatterns: ['/node_modules/(?!memfs|nock|@octokit)/'],
7+
transform: {
8+
'^.+\\.js$': 'babel-jest',
9+
'^.+\\.ts$': 'ts-jest',
10+
},
611
};

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"lint": "npm run format:check && npm run lint:eslint",
1212
"lint:eslint": "eslint --cache '{lib,test}/**/*.ts'",
1313
"test": "npm run lint && npm run build && npm run test:unit",
14-
"test:unit": "node --max-old-space-size=4096 ./node_modules/.bin/jest --runInBand --silent --ci",
14+
"test:unit": "node --max-old-space-size=4096 ./node_modules/.bin/jest --maxWorkers=2 --silent --ci --detectOpenHandles --verbose --testLocationInResults",
1515
"test:unit:debug": "npm run build && DEBUG=* node --max-old-space-size=4096 ./node_modules/.bin/jest",
1616
"test:coverage": "npm run test:unit -- --coverage",
1717
"test:watch": "tsc-watch --onSuccess 'npm run test:unit'",
@@ -43,9 +43,9 @@
4343
"dependencies": {
4444
"@gitbeaker/core": "35.7.0",
4545
"@gitbeaker/node": "35.7.0",
46-
"@octokit/auth-app": "^5.0.0",
46+
"@octokit/auth-app": "^8.1.1",
4747
"@octokit/plugin-retry": "4.0.3",
48-
"@octokit/rest": "19.0.5",
48+
"@octokit/rest": "^22.0.0",
4949
"base-64": "^1.0.0",
5050
"bottleneck": "2.19.5",
5151
"bunyan": "1.8.15",
@@ -58,15 +58,16 @@
5858
"rimraf": "^5.0.7",
5959
"simple-git": "3.16.0",
6060
"sleep-promise": "8.0.1",
61-
"snyk-request-manager": "1.8.4",
61+
"snyk-request-manager": "^1.9.0",
6262
"source-map-support": "^0.5.16",
6363
"split": "1.0.1",
6464
"tslib": "^2.6.0",
6565
"yargs": "16.2.0"
6666
},
6767
"devDependencies": {
68+
"@babel/preset-env": "^7.28.3",
6869
"@octokit/types": "6.14.2",
69-
"@semantic-release/exec": "5.0.0",
70+
"@semantic-release/exec": "^6.0.3",
7071
"@types/base-64": "^1.0.0",
7172
"@types/bunyan": "1.8.6",
7273
"@types/debug": "4.1.5",
@@ -79,21 +80,23 @@
7980
"@types/split": "1.0.0",
8081
"@typescript-eslint/eslint-plugin": "^8.46.0",
8182
"@typescript-eslint/parser": "^8.46.0",
83+
"babel-jest": "^30.2.0",
8284
"eslint": "^9.37.0",
8385
"eslint-config-prettier": "^10.1.8",
8486
"eslint-plugin-check-file": "^3.3.0",
8587
"jest": "^29.7.0",
88+
"memfs": "^4.49.0",
8689
"nock": "^13.2.1",
8790
"prettier": "2.7.1",
88-
"semantic-release": "17.3.0",
91+
"semantic-release": "^24.2.9",
8992
"ts-jest": "^29.1.5",
9093
"tsc-watch": "^4.1.0",
9194
"typescript": "^5.9.3",
9295
"uuid": "9.0.0"
9396
},
9497
"overrides": {
9598
"snyk-request-manager": {
96-
"axios": "1.7.4"
99+
"axios": "^1.11.0"
97100
}
98101
},
99102
"pkg": {

0 commit comments

Comments
 (0)