Skip to content

Commit

Permalink
release 1.0.5
Browse files Browse the repository at this point in the history
- test: cleanups
- dev: dep shedding
- package.json: declare files, reduce module pack size
- ci: add on.pull_request
  • Loading branch information
msimerson committed Apr 4, 2024
1 parent f8e7d1d commit dc93256
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI

on: [ push ]
on: [ push, pull_request ]

env:
CI: true
Expand Down
9 changes: 8 additions & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -28,4 +36,3 @@
- initial release


[1.0.4]: https://github.com/haraka/haraka-dsn/releases/tag/1.0.4
19 changes: 12 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {}
}
27 changes: 9 additions & 18 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';

const assert = require('assert')

Expand All @@ -7,61 +6,53 @@ 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',
reply: '2.7.0 test msg'
},
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()
})
})

0 comments on commit dc93256

Please sign in to comment.