From caab2c2b6fb0cf9c774720437bb29c5e9187d4ed Mon Sep 17 00:00:00 2001 From: James Sumners Date: Sun, 27 Mar 2022 13:12:16 -0400 Subject: [PATCH] Update dependencies and CI (#796) * Update dependencies * Run CI for "next" releases * Grrr * Update target versions * Fix test on Node 17 * Fix deprecation notice --- .github/workflows/integration.yml | 5 +++++ .github/workflows/main.yml | 11 +++++++---- .npmrc | 7 +++++++ package.json | 17 ++++++++--------- test/laundry.test.js | 2 +- test/server.test.js | 4 ++-- 6 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 .npmrc diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5f9cc47..3e360d0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -4,9 +4,14 @@ name: 'Integration Tests' # https://github.community/t5/GitHub-Actions/Github-Actions-services-not-reachable/m-p/30739/highlight/true#M538 on: + push: + branches: + - master + - next pull_request: branches: - master + - next jobs: baseline: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bab1e89..5045895 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,9 +4,11 @@ on: push: branches: - master + - next pull_request: branches: - master + - next jobs: lint: @@ -15,6 +17,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + with: + node-version: 'lts/*' - name: Install Packages run: npm install - name: Lint Code @@ -28,10 +32,9 @@ jobs: - ubuntu-latest - windows-latest node: - - 10.13.0 - - 10.x - - 12.x - - 14.x + - 14 + - 16 + - 17 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b0830fd --- /dev/null +++ b/.npmrc @@ -0,0 +1,7 @@ +# npm general settings +package-lock=false +legacy-peer-deps=true + +# pnpm specific settings +hoist=false +public-hoist-pattern[]=*eslint* diff --git a/package.json b/package.json index 657b2e9..191c0e3 100644 --- a/package.json +++ b/package.json @@ -27,17 +27,17 @@ "verror": "^1.8.1" }, "devDependencies": { - "eslint": "^7.20.0", + "@fastify/pre-commit": "^2.0.2", + "eslint": "8.12.0", "eslint-config-standard": "^16.0.2", "eslint-plugin-import": "^2.22.1", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^5.1.0", + "eslint-plugin-promise": "6.0.0", "front-matter": "^4.0.2", "get-port": "^5.1.1", "highlight.js": "^11.0.1", - "husky": "^4.2.5", "marked": "^4.0.0", - "tap": "15.2.3" + "tap": "16.0.1" }, "scripts": { "test": "tap --no-cov -R terse", @@ -51,9 +51,8 @@ "lint:ci": "eslint .", "docs": "node scripts/build-docs.js" }, - "husky": { - "hooks": { - "pre-commit": "npm run lint:ci && npm run test" - } - } + "pre-commit": [ + "lint:ci", + "test" + ] } diff --git a/test/laundry.test.js b/test/laundry.test.js index 9eb1968..82bea00 100644 --- a/test/laundry.test.js +++ b/test/laundry.test.js @@ -122,7 +122,7 @@ tap.test('GH-55 Client emits connect multiple times', function (t) { t.ok(socket) count++ c.bind('cn=root', 'secret', function (err) { - t.ifError(err) + t.error(err) c.unbind(function () { t.equal(count, 1) t.end() diff --git a/test/server.test.js b/test/server.test.js index 33ed1c8..157fce2 100644 --- a/test/server.test.js +++ b/test/server.test.js @@ -55,7 +55,7 @@ tap.test('properties', function (t) { t.equal(server.url, null, 'url empty before bind') // listen on a random port so we have a url - server.listen(0, 'localhost', function () { + server.listen(0, '127.0.0.1', function () { t.ok(server.url) server.close(() => t.end()) @@ -94,7 +94,7 @@ tap.test('listen on static port', function (t) { tap.test('listen on ephemeral port', function (t) { const server = ldap.createServer() - server.listen(0, 'localhost', function () { + server.listen(0, '127.0.0.1', function () { const addr = server.address() t.ok(addr.port > 0) t.ok(addr.port < 65535)