From f2a65f6e08790d4994415f5c861b4953d43dc337 Mon Sep 17 00:00:00 2001 From: Remco Haszing Date: Mon, 27 Mar 2023 10:54:00 +0200 Subject: [PATCH] Test that the types are valid This is based on the fix in https://github.com/ctimmerm/axios-mock-adapter/pull/368. --- package-lock.json | 20 ++++++++++++++++++++ package.json | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 0f7e259..1990e84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "mocha": "^10.0.0", "nyc": "^15.1.0", "rimraf": "^3.0.2", + "typescript": "^5.0.2", "webpack": "^5.72.1", "webpack-bundle-analyzer": "^4.5.0", "webpack-cli": "^4.9.2" @@ -4884,6 +4885,19 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", + "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=12.20" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -9256,6 +9270,12 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", + "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", + "dev": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/package.json b/package.json index 896c2e1..6a4dfcc 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "main": "src/index.js", "scripts": { "clean": "rimraf dist", - "test": "mocha && npm run test:bundlesize", + "test": "mocha && npm run test:bundlesize && npm run test:types", "test:bundlesize": "npm run clean && npm run build:umd:min && bundlesize", "test:coverage": "nyc --reporter=html --reporter=text-summary mocha", + "test:types": "tsc --project types", "lint": "eslint src test", "build:umd": "webpack --mode development ./src/index.js --output-path ./dist", "build:umd:min": "webpack --mode production ./src/index.js --output-path ./dist", @@ -48,6 +49,7 @@ "mocha": "^10.0.0", "nyc": "^15.1.0", "rimraf": "^3.0.2", + "typescript": "^5.0.2", "webpack": "^5.72.1", "webpack-bundle-analyzer": "^4.5.0", "webpack-cli": "^4.9.2"