From b3e5f34a7f8834c795f553bb308f6de2cccaa924 Mon Sep 17 00:00:00 2001 From: Simon Plenderleith Date: Fri, 20 May 2022 20:30:43 +0100 Subject: [PATCH] Add type checking of TypeScript declarations (#111) `npm test` now runs unit tests and type checking of the TypeScript declarations. This should help avoid issues like #110. --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index eb15c7e..9390761 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ }, "homepage": "https://github.com/simonplend/express-json-validator-middleware#readme", "scripts": { - "test": "tap", + "test": "npm run test:unit && npm run test:types", + "test:unit": "tap", + "test:types": "tsc --noEmit --strict src/index.d.ts", "lint": "eslint \"src/*.js\" --fix", "prepush": "npm run lint && npm run test", "prepublish": "npm run lint && npm run test" @@ -37,7 +39,8 @@ "mocha": "^7.1.1", "prettier": "^1.19.1", "simple-get": "^4.0.0", - "tap": "^15.1.5" + "tap": "^15.1.5", + "typescript": "^4.6.4" }, "dependencies": { "@types/express": "^4.17.3",