From 2fa3d84d6208138010d282edd5c8772d313f7e38 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Thu, 4 Apr 2024 15:41:22 -0700 Subject: [PATCH] release 1.0.5 (#21) - dev: only install mocha/eslint with npx, on demand - pack: declare files to publish (shrink package) #21 - test: remove useless use of done - ci: add on.pull_request --- .github/workflows/ci.yml | 2 +- .release | 2 +- Changes.md | 9 ++++++++- package.json | 19 ++++++++++++------- test/index.js | 27 +++++++++------------------ 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 452832a..ae87d28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: [ push ] +on: [ push, pull_request ] env: CI: true diff --git a/.release b/.release index 9be2b27..954197d 160000 --- a/.release +++ b/.release @@ -1 +1 @@ -Subproject commit 9be2b270ef836bcfefda085674bf62e2a91defe8 +Subproject commit 954197dae07b32c4476ff87ec9ae7371311ec97d diff --git a/Changes.md b/Changes.md index 0ca10be..ed797e7 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,14 @@ ### Unreleased +### 1.0.5 - 2024-04-04 + +- dev: only install mocha/eslint with npx, on demand +- pack: declare files to publish (shrink package) #21 +- test: remove useless use of done +- ci: add on.pull_request + + ### 1.0.4 - 2022-06-05 - ci: update with shared GHA workflows @@ -28,4 +36,3 @@ - initial release -[1.0.4]: https://github.com/haraka/haraka-dsn/releases/tag/1.0.4 diff --git a/package.json b/package.json index a68da8c..db00a5d 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,22 @@ { "name": "haraka-dsn", - "version": "1.0.4", + "version": "1.0.5", "description": "Haraka DSN", "engines": { "node": ">= v14.0.0" }, "main": "index.js", + "files": [ + "Changes.md", + "LICENSE", + "README.md", + "index.js", + "package.json" + ], "scripts": { - "lint": "npx eslint *.js test", - "lintfix": "npx --fix *.js test", - "test": "npx mocha" + "lint": "npx eslint@^8 *.js test", + "lintfix": "npx exlint@^8 --fix *.js test", + "test": "npx mocha@^10" }, "repository": { "type": "git", @@ -26,10 +33,8 @@ }, "homepage": "https://github.com/haraka/haraka-dsn#readme", "devDependencies": { - "eslint": ">=8", "eslint-plugin-haraka": "*", - "haraka-constants": "*", - "mocha": ">=9" + "haraka-constants": "*" }, "dependencies": {} } diff --git a/test/index.js b/test/index.js index 67ccc75..4f13976 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,3 @@ -'use strict'; const assert = require('assert') @@ -7,40 +6,35 @@ const constants = require('haraka-constants'); constants.import(global); describe('haraka-dsn', function () { - beforeEach(function (done) { + beforeEach(function () { this.DSN = require('../index') - done() }) - - it('should load', function (done) { + it('should load', function () { assert.ok(this.DSN); - done() }) - it('create, only code', function (done) { + it('create, only code', function () { assert.deepEqual({ code: 200, msg: undefined, cls: 2, sub: 0, det: 0, default_msg: 'Other undefined status', reply: '2.0.0 Other undefined status' }, this.DSN.create(200) - ); - done() + ) }) - it('create, code w/msg', function (done) { + it('create, code w/msg', function () { assert.deepEqual({ code: 200, msg: 'test msg', cls: 2, sub: 0, det: 0, default_msg: 'Other undefined status', reply: '2.0.0 test msg' }, this.DSN.create(200, 'test msg') - ); - done() + ) }) - it('create, code w/msg & subject', function (done) { + it('create, code w/msg & subject', function () { assert.deepEqual({ code: 200, msg: 'test msg', cls: 2, sub: 7, det: 0, default_msg: 'Other or undefined security status', @@ -48,20 +42,17 @@ describe('haraka-dsn', function () { }, this.DSN.create(200, 'test msg', 7) ); - done() }) - it('net_unspecified returns expected code & message', function (done) { + it('net_unspecified returns expected code & message', function () { const r = this.DSN.net_unspecified() assert.equal(r.code, 450) assert.equal(r.default_msg, 'Other or undefined network or routing status') - done() }) - it('net_unable_to_route returns expected code & message', function (done) { + it('net_unable_to_route returns expected code & message', function () { const r = this.DSN.net_unable_to_route() assert.equal(r.code, 550) assert.equal(r.default_msg, 'Unable to route') - done() }) })