Skip to content

Commit

Permalink
DE-612: Added codegeignore config moved e2e folder configuration for …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
Alberto Blacutt authored and Alberto Blacutt committed Nov 23, 2023
1 parent 641e9c0 commit f2855dc
Show file tree
Hide file tree
Showing 23 changed files with 4,691 additions and 33 deletions.
5 changes: 5 additions & 0 deletions .codegenignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
e2e/**
.gitignore
pnpm-lock.yaml
.github/**
.husky
15 changes: 3 additions & 12 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests on node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Build & run E2E tests
name: Build Typescript-SDK
on:
push:
branches: ['tests']
branches: ['main']
pull_request:
branches: ['tests']
branches: ['main']

jobs:
build:
Expand All @@ -29,14 +29,5 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint verification
run: pnpm run lint
- name: Build process verification
run: pnpm run build
- name: e2e tests verification
env:
SDK_KEY: ${{ secrets.CHARGIFY_API_KEY }}
PASSWORD: ${{ secrets.PASSWORD }}
SUBDOMAIN: ${{ secrets.SUBDOMAIN }}
DOMAIN: ${{ secrets.DOMAIN }}
run: pnpm run test
41 changes: 41 additions & 0 deletions .github/workflows/tests.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run e2e tests
on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
working-directory: ./e2e
run: pnpm install --frozen-lockfile
- name: Lint verification
run: pnpm run lint
working-directory: ./e2e
- name: e2e tests verification
working-directory: ./e2e
env:
SDK_KEY: ${{ secrets.CHARGIFY_API_KEY }}
PASSWORD: ${{ secrets.PASSWORD }}
SUBDOMAIN: ${{ secrets.SUBDOMAIN }}
DOMAIN: ${{ secrets.DOMAIN }}

run: pnpm run test
6 changes: 6 additions & 0 deletions e2e/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.log
.DS_Store
node_modules
dist
coverage
test
6 changes: 6 additions & 0 deletions e2e/.lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"*.ts": [
"prettier --write",
"eslint"
]
}
10 changes: 10 additions & 0 deletions e2e/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
testEnvironment: 'node',
preset: 'ts-jest',
globals: {
'ts-jest': {
tsConfig: 'tsconfig.base.json',
},
},
globalTeardown: "./src/utils/testTeardown.ts",
};
51 changes: 51 additions & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"version": "0.0.1",
"license": "MIT",
"sideEffects": false,
"scripts": {
"test": "jest",
"coverage": "jest --coverage",
"lint": "eslint --ignore-path .eslintignore --ext spec.js,spec.ts .",
"format": "prettier --write \"src/e2e/**/*.{js,ts}\""
},
"prettier": {
"printWidth": 80,
"semi": true,
"singleQuote": true,
"trailingComma": "es5"
},
"name": "advanced-billing-sdk-e2e",
"description": "e2e testing module",
"author": {
"name": "MaxioSDK",
"email": "[email protected]"
},
"devDependencies": {
"@types/jest": "^29.4.0",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"eslint": "^8.34.0",
"husky": "^8.0.0",
"jest": "^29.4.3",
"lint-staged": "^15.0.2",
"prettier": "^3.0.3",
"ts-jest": "^29.0.5",
"tslib": "^2.5.0",
"typescript": "^4.9.5"
},
"repository": {
"type": "git",
"url": "https://github.com/maxio-com/ab-typescript-sdk.git"
},
"bugs": {
"email": "[email protected]"
},
"keywords": [
"advancedbillingsdk",
"maxio"
],
"contributors": [],
"dependencies": {
"dotenv": "^16.3.1"
}
}
Loading

0 comments on commit f2855dc

Please sign in to comment.