Skip to content

Commit bb18f05

Browse files
authored
Merge pull request #82 from CheckmarxDev/other/fix-proxy-handler
Fix proxy handler and add unit test (AST-86031)
2 parents 3f334ff + 27d7187 commit bb18f05

File tree

8 files changed

+8388
-11906
lines changed

8 files changed

+8388
-11906
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
name: AST Javascript wrapper CI
22

3-
on: [pull_request]
3+
on: [ pull_request ]
44
jobs:
5+
unit-tests:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Use Node.js 22.11.0
10+
uses: actions/[email protected]
11+
with:
12+
node-version: 22.11.0
13+
registry-url: https://npm.pkg.github.com/
14+
- run: npm ci
15+
- name: Run Unit Tests
16+
17+
run: npm run test:unit
518
integration-tests:
619
runs-on: ubuntu-latest
720
steps:
8-
- uses: actions/checkout@v4
9-
- name: Use Node.js 22.11.0
10-
uses: actions/[email protected]
11-
with:
12-
node-version: 22.11.0
13-
registry-url: https://npm.pkg.github.com/
14-
- run: npm ci
15-
- name: Code Linting
16-
run: npm run lint
17-
- run: npm run build --if-present
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js 22.11.0
23+
uses: actions/[email protected]
24+
with:
25+
node-version: 22.11.0
26+
registry-url: https://npm.pkg.github.com/
27+
- run: npm ci
28+
- name: Code Linting
29+
run: npm run lint
30+
- run: npm run build --if-present
1831

19-
- name: Run tests
20-
env:
21-
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
22-
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
23-
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
24-
CX_TENANT: ${{ secrets.CX_TENANT }}
25-
CX_APIKEY: ${{ secrets.CX_APIKEY }}
26-
run: npm test
32+
- name: Run tests
33+
env:
34+
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
35+
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
36+
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
37+
CX_TENANT: ${{ secrets.CX_TENANT }}
38+
CX_APIKEY: ${{ secrets.CX_APIKEY }}
39+
run: npm test

jest.config.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828
// preset configs
2929
// preset: 'ts-jest/presets/js-with-ts',
3030
// which files to test and which to ignore
31-
testMatch: ['**/src/tests/*.test.(ts|tsx)'],
31+
testMatch: ['**/src/tests/**/*.test.(ts|tsx)'],
3232
testPathIgnorePatterns: ['/node_modules/', '/tmp/', '/coverage/', '/stories/', '/\\.storybook/'],
3333
// don't watch for file changes in node_modules
3434
watchPathIgnorePatterns: ['/node_modules/'],
@@ -41,15 +41,14 @@ module.exports = {
4141
// setupFilesAfterEnv: [`${__dirname}/setup/setupAfterEnv.ts`],
4242
// coverage settings
4343
collectCoverage: true,
44-
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'],
45-
coverageThreshold: {
44+
coverageThreshold: {
4645
"global": {
47-
"branches": 60,
48-
"functions": 80,
49-
"lines": 80,
50-
"statements": 80
46+
"branches": 60,
47+
"functions": 80,
48+
"lines": 80,
49+
"statements": 80
5150
}
52-
},
51+
},
5352
coveragePathIgnorePatterns: ['/node_modules/', '\\.json$', '/__tests__/', '/stories/', '/\\.storybook/'],
5453

5554
globals: {

0 commit comments

Comments
 (0)