diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1f7b731 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +on: + push: + branches: + - master + pull_request: +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [18, 20, 22] + steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + - name: Install + run: npm install + - name: Test / Lint / Codestyle + run: make all + test-optional: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [24] + steps: + - name: Checkout + uses: actions/checkout@v5 + - name: Setup Node.js + uses: actions/setup-node@v5 + with: + node-version: ${{ matrix.node-version }} + - name: Install + run: npm install + - name: Test / Lint / Codestyle + run: make all diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 396be4c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -cache: - npm: false -language: node_js -node_js: - - '8' - - '10' - - '12' - - "lts/*" # Active LTS release - - "node" # Latest stable release -after_success: - - make report-coverage diff --git a/Makefile b/Makefile index e4f760d..22a5c57 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,6 @@ COVERAGE := $(ROOT)/coverage # # Tools and binaries # -YARN := yarn NPM := npm COVERALLS := $(NODE_BIN)/coveralls ESLINT := $(NODE_BIN)/eslint @@ -36,7 +35,7 @@ CONVENTIONAL_RECOMMENDED_BUMP := $(NODE_BIN)/conventional-recommended-bump # LCOV := $(ROOT)/coverage/lcov.info PACKAGE_JSON := $(ROOT)/package.json -YARN_LOCK := $(ROOT)/yarn.lock +PKG_LOCK := $(ROOT)/package-lock.json GITHOOKS := $(wildcard $(GITHOOKS_SRC)/*) ALL_FILES := $(shell find $(ROOT) \ -not \( -path $(NODE_MODULES) -prune \) \ @@ -59,12 +58,12 @@ help: all: node_modules lint test clean-coverage -$(YARN_LOCK): $(PACKAGE_JSON) - @$(YARN) +$(PKG_LOCK): $(PACKAGE_JSON) + @$(NPM) install $(NODE_MODULES): $(PACKAGE_JSON) - @$(YARN) + @$(NPM) install @touch $(NODE_MODULES) diff --git a/README.md b/README.md index ce33947..4507876 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,6 @@ # restify-errors -[![NPM Version](https://img.shields.io/npm/v/restify-errors.svg)](https://npmjs.org/package/restify-errors) -[![Build Status](https://travis-ci.org/restify/errors.svg?branch=master)](https://travis-ci.org/restify/errors) -[![Coverage Status](https://coveralls.io/repos/restify/errors/badge.svg?branch=master)](https://coveralls.io/r/restify/errors?branch=master) -[![Dependency Status](https://david-dm.org/restify/errors.svg)](https://david-dm.org/restify/errors) -[![devDependency Status](https://david-dm.org/restify/errors/dev-status.svg)](https://david-dm.org/restify/errors#info=devDependencies) +[![Build Status](https://github.com/restify/errors/actions/workflows/test.yml/badge.svg)](https://github.com/restify/errors/actions/workflows/test.yml) > A collection of HTTP and REST Error constructors. diff --git a/lib/baseClasses/HttpError.js b/lib/baseClasses/HttpError.js index 106ae2e..d5f0428 100644 --- a/lib/baseClasses/HttpError.js +++ b/lib/baseClasses/HttpError.js @@ -159,7 +159,8 @@ HttpError.prototype.toJSON = function toJSON() { return { code: self.body.code, - message: message + message: message, + cause: self.cause }; }; diff --git a/package.json b/package.json index 0721752..1e6b0e9 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "mkdirp": "^0.5.1", "mocha": "^6.2.2", "nyc": "^14.1.1", - "restify": "^8.5.0", - "restify-clients": "^2.6.7", + "restify": "^11.1.0", + "restify-clients": "^4.2.0", "unleash": "^2.0.1" }, "optionalDependencies": {