Skip to content

Commit

Permalink
chore: updated devDependencies
Browse files Browse the repository at this point in the history
* also fixed unit tests for fatal error checking
* formating
  • Loading branch information
Bugs5382 committed Jan 22, 2025
1 parent 11f6ae1 commit c80bb5b
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 73 deletions.
52 changes: 3 additions & 49 deletions .npmpackagejsonlintrc.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,6 @@
{
"extends": "npm-package-json-lint-config-default",
"rules": {
"require-author": "error",
"require-description": "error",
"require-engines": "error",
"require-license": "error",
"require-name": "error",
"require-repository": "error",
"require-version": "error",
"require-bugs": "error",
"require-homepage": "error",
"require-keywords": "error",
"bin-type": "error",
"config-type": "error",
"description-type": "error",
"devDependencies-type": "error",
"directories-type": "error",
"engines-type": "error",
"files-type": "error",
"homepage-type": "error",
"keywords-type": "error",
"license-type": "error",
"main-type": "error",
"man-type": "error",
"name-type": "error",
"preferGlobal-type": "error",
"private-type": "error",
"repository-type": "error",
"scripts-type": "error",
"version-type": "error",
"valid-values-author": ["error", [
"Shane Froebel"
]],
"valid-values-private": ["error", [
false
]],
"no-restricted-dependencies": ["error", [
"gulping-npm-package-json-lint"
]],
"no-restricted-pre-release-dependencies": ["error", [
"gulping-npm-package-json-lint"
]],
"no-restricted-devDependencies": ["error", [
"gulping-npm-package-json-lint"
]],
"no-restricted-pre-release-devDependencies": ["error", [
"gulping-npm-package-json-lint"
]],
"name-format": "error",
"version-format": "error"
"valid-values-author": ["error", ["Shane Froebel"]]
}
}
}
23 changes: 18 additions & 5 deletions __tests__/hl7.sanity.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { describe, expect, test } from "vitest";
import { Batch, FileBatch, isBatch, isFile, Message } from "../src";
import {
Batch,
FileBatch,
HL7FatalError,
isBatch,
isFile,
Message,
} from "../src";
import { HL7_2_4 } from "../src/specification/2.4";
import { MSH_HEADER } from "./__data__/constants";

Expand All @@ -11,7 +18,9 @@ describe("node hl7 client - sanity tests", () => {
const message = new Message();
} catch (err) {
expect(err).toEqual(
new Error("mshHeader must be set if no HL7 message is being passed."),
new HL7FatalError(
"mshHeader must be set if no HL7 message is being passed.",
),
);
}
});
Expand All @@ -21,7 +30,9 @@ describe("node hl7 client - sanity tests", () => {
new Message({ text: "" });
} catch (err) {
expect(err).toEqual(
new Error("mshHeader must be set if no HL7 message is being passed."),
new HL7FatalError(
"mshHeader must be set if no HL7 message is being passed.",
),
);
}
});
Expand Down Expand Up @@ -190,7 +201,9 @@ describe("node hl7 client - sanity tests", () => {
});
} catch (err) {
expect(err).toEqual(
new Error("Unable to process a single MSH as a batch. Use Message."),
new HL7FatalError(
"Unable to process a single MSH as a batch. Use Message.",
),
);
}
});
Expand Down Expand Up @@ -325,7 +338,7 @@ describe("node hl7 client - sanity tests", () => {
const message = new Message({ text: hl7_batch_msh_string });
} catch (err) {
expect(err).toEqual(
new Error("Multiple MSH segments found. Use Batch."),
new HL7FatalError("Multiple MSH segments found. Use Batch."),
);
}
});
Expand Down
38 changes: 21 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"build:watch": "tsc -p src/tsconfig.esm.json -w",
"build:watch:cjs": "tsc -p src/tsconfig.cjs.json -w",
"npm:lint": "npmPkgJsonLint .",
"format": "prettier --write 'pages/**/*.md' 'src/**/*.ts' '__tests__/**/*.ts'",
"format": "prettier --write 'pages/**/*.md' 'src/**/*.ts' '__tests__/**/*.ts' '*.json'",
"lint": "npm run npm:lint && eslint | snazzy",
"lint:fix": "npm run npm:lint && eslint --fix | snazzy",
"pack": "npm pack",
Expand Down Expand Up @@ -73,31 +73,35 @@
},
"homepage": "https://github.com/Bugs5382/node-hl7-client#readme",
"devDependencies": {
"@eslint/js": "^9.15.0",
"@eslint/js": "^9.18.0",
"@types/eslint__js": "^8.42.3",
"@types/node": "^22.9.0",
"@types/node": "^22.10.7",
"@types/tcp-port-used": "^1.0.4",
"@typescript-eslint/eslint-plugin": "^8.14.0",
"@typescript-eslint/parser": "^8.14.0",
"@vitest/coverage-v8": "^2.1.5",
"@vitest/ui": "^2.1.5",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.12.0",
"node-hl7-server": "^3.0.1-beta.1",
"npm-check-updates": "^17.1.11",
"@typescript-eslint/eslint-plugin": "^8.21.0",
"@typescript-eslint/parser": "^8.21.0",
"@vitest/coverage-v8": "^3.0.3",
"@vitest/ui": "^3.0.3",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
"globals": "^15.14.0",
"i": "^0.3.7",
"node-hl7-server": "^3.1.0",
"npm": "^11.0.0",
"npm-check-updates": "^17.1.14",
"npm-package-json-lint": "^8.0.0",
"npm-package-json-lint-config-default": "^7.0.1",
"portfinder": "^1.0.32",
"pre-commit": "^1.2.2",
"snazzy": "^9.0.0",
"tcp-port-used": "^1.0.2",
"ts-node": "^10.9.2",
"tsd": "^0.31.2",
"typedoc": "^0.26.11",
"typescript": "^5.6.3",
"typescript-eslint": "^8.14.0",
"vitest": "^2.1.5"
"typedoc": "^0.27.6",
"typescript": "^5.7.3",
"typescript-eslint": "^8.21.0",
"vitest": "^3.0.3"
},
"precommit": [
"lint:fix",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export type {
ClientBuilderMessageOptions,
ClientBuilderOptions,
} from "./utils/normalizedBuilder.js";
export type {
export {
HL7Error,
HL7FatalError,
HL7ParserError,
Expand Down
2 changes: 1 addition & 1 deletion typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
"@alpha": false,
"@beta": false
}
}
}
1 change: 1 addition & 0 deletions vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
coverage: {
provider: 'v8',
exclude: [
'__tests__/__utils__/**',
'docker',
Expand Down

0 comments on commit c80bb5b

Please sign in to comment.