Skip to content

Commit

Permalink
Test Coverage - Staking Transactions - error path (#25)
Browse files Browse the repository at this point in the history
* Add StakingTransaction unhappy path unit tests
  • Loading branch information
jeremy-babylonlabs authored Jun 14, 2024
1 parent efe2b03 commit c482ac6
Show file tree
Hide file tree
Showing 8 changed files with 4,494 additions and 895 deletions.
27 changes: 22 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ orbs:
node: circleci/[email protected]

jobs:
build_and_test:
machine:
image: ubuntu-2204:2024.01.1
steps:
- checkout
- node/install:
node-version: '21.7'
- run:
name: Install requirements
command: npm install
- run:
name: Run tests
command: npm run tests

publish:
machine:
image: ubuntu-2204:2024.01.1
Expand All @@ -16,14 +30,16 @@ jobs:
name: Authenticate with NPM registry
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
- run:
name: Install requirements and publish package
command: |
npm install
npm publish
name: Install requirements
command: npm install
- run:
name: Publish package
command: npm publish

workflows:
CI:
jobs:
- build_and_test
- require_approval:
type: approval
filters:
Expand All @@ -32,10 +48,11 @@ workflows:
- main
- publish:
requires:
- build_and_test
- require_approval
filters:
tags:
only: /.*/
branches:
only:
- main
- main
21 changes: 21 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/tests/**/*.test.ts', '**/?(*.)+(spec|test).ts'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
tsconfig: 'tsconfig.jest.json',
}
]
},
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/*.d.ts'
],
coverageDirectory: 'coverage'
};
Loading

0 comments on commit c482ac6

Please sign in to comment.