From c3d882004e0885778a54688291396f03fb05e502 Mon Sep 17 00:00:00 2001 From: Samuel Ryan Date: Thu, 21 Nov 2024 13:58:52 +0800 Subject: [PATCH] test: Run test app in GitHub Workflows --- .github/workflows/test.yaml | 4 +++ test-app/package-lock.json | 67 +++++++++++++++++++++++++------------ test-app/package.json | 2 +- 3 files changed, 50 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 338b9ef..ea3677c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -17,5 +17,9 @@ jobs: node-version: ${{ matrix.version }} - run: npm ci - run: npm test + - run: npm build + - run: cd test-app + - run: npm install + - run: node index.js env: IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }} diff --git a/test-app/package-lock.json b/test-app/package-lock.json index 2736fda..e0fea3a 100644 --- a/test-app/package-lock.json +++ b/test-app/package-lock.json @@ -1,7 +1,7 @@ { "name": "test-app", "version": "1.0.0", - "lockfileVersion": 3, + "lockfileVersion": 2, "requires": true, "packages": { "": { @@ -9,37 +9,36 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "node-ipinfo": "3.5.5", + "node-ipinfo": "file: ./../../", "typescript": "^4.4.2" } }, - "node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } - }, - "node_modules/node-ipinfo": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/node-ipinfo/-/node-ipinfo-3.5.5.tgz", - "integrity": "sha512-EP1ZOXJgMwT8BVZe+erwiHn9AyvzFZWdjSuTXHS5WzKTrhO6Ak/5WIKd6xiKRcW7FY52F+ikewzqjXUQeAz7Lg==", + "..": { + "version": "4.0.0", + "license": "Apache-2.0", "dependencies": { "lru-cache": "^7.18.3", + "node-fetch": "^2.7.0", "subnet-check": "^1.10.1" }, + "devDependencies": { + "@types/jest": "^29.5.3", + "@types/node": "^18.15.0", + "dotenv": "^8.6.0", + "jest": "^29.6.2", + "jest-dev-server": "^10.1.4", + "prettier": "^2.4.1", + "test-fake-server": "^2.9.3", + "ts-jest": "^29.1.1", + "typescript": "^5.1.6" + }, "engines": { - "node": ">=10" + "node": ">=14" } }, - "node_modules/subnet-check": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/subnet-check/-/subnet-check-1.10.1.tgz", - "integrity": "sha512-e8lXZ9ICcG42fFsMDZO5TTZ3uS2436b5hnx3uS4Z3XkAFuDLa5R3Pvt9lYhewKm/vCd48t14v0jFaSmVYOT2Kg==", - "engines": { - "node": ">=4.0.0" - } + "node_modules/node-ipinfo": { + "resolved": "..", + "link": true }, "node_modules/typescript": { "version": "4.4.2", @@ -53,5 +52,29 @@ "node": ">=4.2.0" } } + }, + "dependencies": { + "node-ipinfo": { + "version": "file:..", + "requires": { + "@types/jest": "^29.5.3", + "@types/node": "^18.15.0", + "dotenv": "^8.6.0", + "jest": "^29.6.2", + "jest-dev-server": "^10.1.4", + "lru-cache": "^7.18.3", + "node-fetch": "^2.7.0", + "prettier": "^2.4.1", + "subnet-check": "^1.10.1", + "test-fake-server": "^2.9.3", + "ts-jest": "^29.1.1", + "typescript": "^5.1.6" + } + }, + "typescript": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.2.tgz", + "integrity": "sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==" + } } } diff --git a/test-app/package.json b/test-app/package.json index 27d5561..9616d8d 100644 --- a/test-app/package.json +++ b/test-app/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "dependencies": { - "node-ipinfo": "^4.0.0", + "node-ipinfo": "file: ./../../", "typescript": "^4.4.2" } }