Skip to content
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

Set up for Automated Node sdk tests #21

Merged
merged 28 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e949264
Basic Test Setup
pranav649 Nov 9, 2023
58b9865
added env for secrets
pranav-sdet-cashfree Nov 9, 2023
d228fab
added test results
pranav-sdet-cashfree Nov 9, 2023
87587f0
added test results
pranav-sdet-cashfree Nov 9, 2023
70260f1
Added Run Tests step
pranav-sdet-cashfree Nov 9, 2023
45b891b
debug
pranav-sdet-cashfree Nov 9, 2023
3d467c3
debug
pranav-sdet-cashfree Nov 9, 2023
62f4a05
cc
pranav-sdet-cashfree Nov 9, 2023
b94ac9c
fixed failed test
pranav-sdet-cashfree Nov 16, 2023
8171868
added tests
pranav-sdet-cashfree Nov 20, 2023
5e4df22
added test coverage link
pranav-sdet-cashfree Nov 20, 2023
d79a032
fixed failed tests
pranav-sdet-cashfree Nov 20, 2023
eb1fe1c
change
pranav-sdet-cashfree Nov 20, 2023
f91108a
Removed Mocha and Added Jest
pranav-sdet-cashfree Nov 22, 2023
311a38d
Splitted tests to different files
pranav-sdet-cashfree Nov 22, 2023
7966a6d
added tests
pranav-sdet-cashfree Nov 28, 2023
96af7ad
added tests
pranav-sdet-cashfree Nov 28, 2023
883a2c4
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
65c4280
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
483e039
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
9824adf
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
944515a
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
f9bb108
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
b467ba1
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
fc51d03
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
38bfcd0
modified run-tests.yml
pranav-sdet-cashfree Nov 28, 2023
1f6d5a5
modified
pranav-sdet-cashfree Nov 28, 2023
171d047
modified
pranav-sdet-cashfree Nov 28, 2023
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
26 changes: 26 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Trigger Tests on Pull Request.

on:
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '21.x'
- name: Install dependencies
run: npm install
- name: Run Tests
run: CLIENT_ID=$PG_CLIENT_ID SECRET_KEY=$PG_CLIENT_SECRET npm test
env:
PG_CLIENT_ID: ${{ secrets.XCLIENTIDSANDBOX }}
PG_CLIENT_SECRET: ${{ secrets.XCLIENTSECRETSANDBOX }}

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
wwwroot/*.js
node_modules
coverage
typings
dist
package-lock.json
test-results
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Cashfree PG Node SDK
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-pg-sdk-nodejs) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-pg-sdk-nodejs/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-pg-sdk-nodejs?label=latest) ![npm](https://img.shields.io/npm/v/cashfree-pg) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-pg-sdk-nodejs)
![GitHub](https://img.shields.io/github/license/cashfree/cashfree-pg-sdk-nodejs) ![Discord](https://img.shields.io/discord/931125665669972018?label=discord) ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cashfree/cashfree-pg-sdk-nodejs/main) ![GitHub release (with filter)](https://img.shields.io/github/v/release/cashfree/cashfree-pg-sdk-nodejs?label=latest) ![npm](https://img.shields.io/npm/v/cashfree-pg) ![GitHub forks](https://img.shields.io/github/forks/cashfree/cashfree-pg-sdk-nodejs) [![Tests](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/run-tests.yml) [![Build and Publish](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/publish.yml/badge.svg)](https://github.com/cashfree/cashfree-pg-sdk-nodejs/actions/workflows/publish.yml)

The Cashfree PG Node SDK offers a convenient solution to access [Cashfree PG APIs](https://docs.cashfree.com/reference/pg-new-apis-endpoint) from a server-side JavaScript applications.

Expand Down
4 changes: 4 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@
"sideEffects": false,
"scripts": {
"build": "tsc && tsc -p tsconfig.esm.json",
"prepare": "npm run build"
"prepare": "npm run build",
"test": "jest --coverage"
},
"dependencies": {
"axios": "1.5.1",
"@sentry/node": "^7.73.0"
"@sentry/node": "^7.73.0",
"axios": "1.5.1"
},
"devDependencies": {
"@types/node": "^12.11.5",
"typescript": "^4.0"
"@types/chai": "^4.3.10",
"@types/jest": "^29.5.10",
"@types/node": "^12.20.55",
"@types/react": "^18.2.39",
"@types/sinon": "^17.0.1",
"chai": "^4.3.10",
"jest": "^29.7.0",
"mocha-junit-reporter": "^2.2.1",
"sinon": "^17.0.1",
"ts-jest": "^29.1.1",
"typescript": "^4.9.5"
}
}
Loading