diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a1155d..9f40473 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/github-action@v1.1.2 + with: + github-token: ${{ github.token }} diff --git a/package.json b/package.json index 86b7420..175068a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" @@ -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", diff --git a/src/app.test.js b/src/app.test.js index fa1ffc6..e408840 100644 --- a/src/app.test.js +++ b/src/app.test.js @@ -6,7 +6,7 @@ import { clearKeyv, initializeTransactionManager } from './transactionManager.js' - +import TransactionException from './TransactionException.js' let app describe('api', function () { @@ -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) + }) + }) })