Skip to content

Fix proxy handler and add unit test (AST-86031) #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 32 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
name: AST Javascript wrapper CI

on: [pull_request]
on: [ pull_request ]
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.11.0
uses: actions/[email protected]
with:
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci
- name: Run Unit Tests

run: npm run test:unit
integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.11.0
uses: actions/[email protected]
with:
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci
- name: Code Linting
run: npm run lint
- run: npm run build --if-present
- uses: actions/checkout@v4
- name: Use Node.js 22.11.0
uses: actions/[email protected]
with:
node-version: 22.11.0
registry-url: https://npm.pkg.github.com/
- run: npm ci
- name: Code Linting
run: npm run lint
- run: npm run build --if-present

- name: Run tests
env:
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
CX_TENANT: ${{ secrets.CX_TENANT }}
CX_APIKEY: ${{ secrets.CX_APIKEY }}
run: npm test
- name: Run tests
env:
CX_CLIENT_ID: ${{ secrets.CX_CLIENT_ID}}
CX_CLIENT_SECRET: ${{ secrets.CX_CLIENT_SECRET}}
CX_BASE_URI: ${{ secrets.CX_BASE_URI }}
CX_TENANT: ${{ secrets.CX_TENANT }}
CX_APIKEY: ${{ secrets.CX_APIKEY }}
run: npm test
15 changes: 7 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
// preset configs
// preset: 'ts-jest/presets/js-with-ts',
// which files to test and which to ignore
testMatch: ['**/src/tests/*.test.(ts|tsx)'],
testMatch: ['**/src/tests/**/*.test.(ts|tsx)'],
testPathIgnorePatterns: ['/node_modules/', '/tmp/', '/coverage/', '/stories/', '/\\.storybook/'],
// don't watch for file changes in node_modules
watchPathIgnorePatterns: ['/node_modules/'],
Expand All @@ -41,15 +41,14 @@ module.exports = {
// setupFilesAfterEnv: [`${__dirname}/setup/setupAfterEnv.ts`],
// coverage settings
collectCoverage: true,
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'],
coverageThreshold: {
coverageThreshold: {
"global": {
"branches": 60,
"functions": 80,
"lines": 80,
"statements": 80
"branches": 60,
"functions": 80,
"lines": 80,
"statements": 80
}
},
},
coveragePathIgnorePatterns: ['/node_modules/', '\\.json$', '/__tests__/', '/stories/', '/\\.storybook/'],

globals: {
Expand Down
Loading