Skip to content

Commit

Permalink
add coveralls to action
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed May 28, 2024
1 parent 21c5532 commit 2120831
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Run test with Node.js ${{ matrix.node-version }}
run: npm run test
run: npm run coveralls
env:
CI: true
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
github-token: ${{ github.token }}

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@digitalcredentials/transaction-manager-service",
"name": "@digitalcredentials/transaction-service",
"description": "An express app for managing challenges in a DIDAuth exchange.",
"version": "0.0.1",
"type": "module",
Expand All @@ -8,7 +8,7 @@
"dev": "nodemon -r dotenv/config server.js",
"dev-noenv": "nodemon server.js",
"test": "NODE_OPTIONS=--experimental-vm-modules npx c8 mocha --timeout 10000 -r dotenv/config dotenv_config_path=src/test-fixtures/.env.testing src/app.test.js ",
"coveralls": "npm run test; c8 report --reporter=text-lcov | coveralls",
"coveralls": "npm run test; npx c8 report --reporter=text-lcov",
"prepare": "test -d node_modules/husky && husky install || echo \"husky is not installed\"",
"lint": "eslint",
"lint-fix": "eslint --fix"
Expand Down Expand Up @@ -37,6 +37,7 @@
"devDependencies": {
"@eslint/js": "^9.3.0",
"chai": "^4.3.7",
"coveralls": "^3.1.1",
"eslint": "^9.3.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-mocha": "^10.4.3",
Expand Down
14 changes: 13 additions & 1 deletion src/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
clearKeyv,
initializeTransactionManager
} from './transactionManager.js'

import TransactionException from './TransactionException.js'
let app

describe('api', function () {
Expand Down Expand Up @@ -72,4 +72,16 @@ describe('api', function () {
initializeTransactionManager()
})
})

describe('TransactionException', function () {
it('sets props on Exception', function () {
const code = 404
const message = 'a test message'
const stack = { test: 'test' }
const obj = new TransactionException(code, message, stack)
expect(obj.code).to.eql(code)
expect(obj.message).to.eql(message)
expect(obj.stack).to.eql(stack)
})
})
})

0 comments on commit 2120831

Please sign in to comment.