From d2f570bc7f4ae9c555c29767fd5dafd977974f13 Mon Sep 17 00:00:00 2001 From: Leela Prasad <47483946+leelaprasadv@users.noreply.github.com> Date: Sun, 10 Sep 2023 13:36:11 +0530 Subject: [PATCH 1/3] update packages and add publish.yaml --- .github/workflows/publish.yml | 19 ++ package-lock.json | 515 ++++++++++++++++++++++++++++++++++ package.json | 14 +- tests/spec.test copy.js.bak | 129 +++++++++ 4 files changed, 670 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 package-lock.json create mode 100644 tests/spec.test copy.js.bak diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..7c5cd16 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,19 @@ +name: Publish +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v2 + with: + node-version: '12.x' + registry-url: 'https://registry.npmjs.org' + - run: npm install + - run: npm test + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..080ae57 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,515 @@ +{ + "name": "pactum-swagger-coverage", + "version": "1.0.1", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "pactum-swagger-coverage", + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "js-yaml": "^4.1.0", + "phin": "^3.7.0" + }, + "devDependencies": { + "pactum": "^3.5.1", + "uvu": "^0.5.6" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@arr/every": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@arr/every/-/every-1.0.1.tgz", + "integrity": "sha512-UQFQ6SgyJ6LX42W8rHCs8KVc0JS0tzVL9ct4XYedJukskYVWTo49tNiMEK9C2HTyarbNiT/RVIRSY82vH+6sTg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@exodus/schemasafe": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", + "dev": true + }, + "node_modules/@polka/url": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", + "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/centra": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/centra/-/centra-2.6.0.tgz", + "integrity": "sha512-dgh+YleemrT8u85QL11Z6tYhegAs3MMxsaWAq/oXeAmYJ7VxL3SI9TZtnfaEvNDMAPolj25FXIb3S+HCI4wQaQ==" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/deep-override": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/deep-override/-/deep-override-1.0.2.tgz", + "integrity": "sha512-+bAuLuYqaVVUWPaq8rmU8NLTX85p4I5k5/cVdhBioEfH7k+5NlGdv4NoJVQcJRByqzzTWWzTpih+pU1wBTmMow==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/form-data-lite": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/form-data-lite/-/form-data-lite-1.0.3.tgz", + "integrity": "sha512-P7xPqAiOPKzC9Q9aywAZJCQq4QOE5WokPb3HrcWRh7C57RKytueJzoORZAVgHBNvK/lL7E+FxjQjd4X/zbecEQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-lite": "^1.0.3" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-query": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/json-query/-/json-query-2.2.2.tgz", + "integrity": "sha1-tlWLijeUzNIXkmqjgCQyS3e0irE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/kleur": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.3.tgz", + "integrity": "sha512-H1tr8QP2PxFTNwAFM74Mui2b6ovcY9FoxJefgrwxY+OCJcq01k5nvhf4M/KnizzrJvLRap5STUy7dgDV35iUBw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/lightcookie": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/lightcookie/-/lightcookie-1.0.25.tgz", + "integrity": "sha512-SrY/+eBPaKAMnsn7mCsoOMZzoQyCyHHHZlFCu2fjo28XxSyCLjlooKiTxyrXTg8NPaHp1YzWi0lcGG1gDi6KHw==", + "dev": true + }, + "node_modules/matchit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/matchit/-/matchit-1.1.0.tgz", + "integrity": "sha512-+nGYoOlfHmxe5BW5tE0EMJppXEwdSf8uBA1GTZC7Q77kbT35+VKLYJMzVNWCHSsga1ps1tPYFtFyvxvKzWVmMA==", + "dev": true, + "dependencies": { + "@arr/every": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/mime-lite": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mime-lite/-/mime-lite-1.0.3.tgz", + "integrity": "sha512-V85l97zJSTG8FEvmdTlmNYb0UMrVBwvRjw7bWTf/aT6KjFwtz3iTz8D2tuFIp7lwiaO2C5ecnrEmSkkMRCrqVw==", + "dev": true + }, + "node_modules/mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/openapi-fuzzer-core": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/openapi-fuzzer-core/-/openapi-fuzzer-core-1.0.6.tgz", + "integrity": "sha512-FJNJIfgUFuv4NmVGq9MYdoKra2GrkDy2uhIjE2YGlw30UA1glf4SXLMhI4UwdcJ8jisKdIxi7lXrfej8GvNW5w==", + "dev": true, + "dependencies": { + "klona": "^2.0.4" + } + }, + "node_modules/pactum": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/pactum/-/pactum-3.5.1.tgz", + "integrity": "sha512-7DcbzGFZkvpdETtyxyB5inhmxFhXh+D/AZwF8fQaxywums4zf1nZO/vNDueogN8UWV1YldUEkuGo+1XlGvz+iQ==", + "dev": true, + "dependencies": { + "@exodus/schemasafe": "^1.2.3", + "deep-override": "^1.0.2", + "form-data-lite": "^1.0.3", + "json-query": "^2.2.2", + "klona": "^2.0.6", + "lightcookie": "^1.0.25", + "openapi-fuzzer-core": "^1.0.6", + "pactum-matchers": "^1.1.6", + "parse-graphql": "^1.0.0", + "phin": "^3.7.0", + "polka": "^0.5.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pactum-matchers": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/pactum-matchers/-/pactum-matchers-1.1.6.tgz", + "integrity": "sha512-55io32NeOKbLpHKKPzYDOr+N2dseTzMbj1Gj1y+zvOkKK6NDf5BT5pxglfqLN/ra3ig5zvbrKFUqZIWjAWboog==", + "dev": true + }, + "node_modules/parse-graphql": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-graphql/-/parse-graphql-1.0.0.tgz", + "integrity": "sha512-NjvQHHaiPCxPZrhm/kKnorxOv7r/eA+tE0VW5E8iJMH9wTqFA1V0YK/7nbpxVu3JdXUxyWTKMez9lsHUtAwa0w==", + "dev": true + }, + "node_modules/phin": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.0.tgz", + "integrity": "sha512-DqnVNrpYhKGBZppNKprD+UJylMeEKOZxHgPB+ZP6mGzf3uA2uox4Ep9tUm+rUc8WLIdHT3HcAE4X8fhwQA9JKg==", + "dependencies": { + "centra": "^2.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/polka": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/polka/-/polka-0.5.2.tgz", + "integrity": "sha512-FVg3vDmCqP80tOrs+OeNlgXYmFppTXdjD5E7I4ET1NjvtNmQrb1/mJibybKkb/d4NA7YWAr1ojxuhpL3FHqdlw==", + "dev": true, + "dependencies": { + "@polka/url": "^0.5.0", + "trouter": "^2.0.1" + } + }, + "node_modules/sade": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", + "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", + "dev": true, + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/trouter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/trouter/-/trouter-2.0.1.tgz", + "integrity": "sha512-kr8SKKw94OI+xTGOkfsvwZQ8mWoikZDd2n8XZHjJVZUARZT+4/VV6cacRS6CLsH9bNm+HFIPU1Zx4CnNnb4qlQ==", + "dev": true, + "dependencies": { + "matchit": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/uvu": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", + "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", + "dev": true, + "dependencies": { + "dequal": "^2.0.0", + "diff": "^5.0.0", + "kleur": "^4.0.3", + "sade": "^1.7.3" + }, + "bin": { + "uvu": "bin.js" + }, + "engines": { + "node": ">=8" + } + } + }, + "dependencies": { + "@arr/every": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@arr/every/-/every-1.0.1.tgz", + "integrity": "sha512-UQFQ6SgyJ6LX42W8rHCs8KVc0JS0tzVL9ct4XYedJukskYVWTo49tNiMEK9C2HTyarbNiT/RVIRSY82vH+6sTg==", + "dev": true + }, + "@exodus/schemasafe": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", + "dev": true + }, + "@polka/url": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", + "integrity": "sha512-oZLYFEAzUKyi3SKnXvj32ZCEGH6RDnao7COuCVhDydMS9NrCSVXhM79VaKyP5+Zc33m0QXEd2DN3UkU7OsHcfw==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "centra": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/centra/-/centra-2.6.0.tgz", + "integrity": "sha512-dgh+YleemrT8u85QL11Z6tYhegAs3MMxsaWAq/oXeAmYJ7VxL3SI9TZtnfaEvNDMAPolj25FXIb3S+HCI4wQaQ==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "deep-override": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/deep-override/-/deep-override-1.0.2.tgz", + "integrity": "sha512-+bAuLuYqaVVUWPaq8rmU8NLTX85p4I5k5/cVdhBioEfH7k+5NlGdv4NoJVQcJRByqzzTWWzTpih+pU1wBTmMow==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "dequal": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.2.tgz", + "integrity": "sha512-q9K8BlJVxK7hQYqa6XISGmBZbtQQWVXSrRrWreHC94rMt1QL/Impruc+7p2CYSYuVIUr+YCt6hjrs1kkdJRTug==", + "dev": true + }, + "diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true + }, + "form-data-lite": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/form-data-lite/-/form-data-lite-1.0.3.tgz", + "integrity": "sha512-P7xPqAiOPKzC9Q9aywAZJCQq4QOE5WokPb3HrcWRh7C57RKytueJzoORZAVgHBNvK/lL7E+FxjQjd4X/zbecEQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-lite": "^1.0.3" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "json-query": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/json-query/-/json-query-2.2.2.tgz", + "integrity": "sha1-tlWLijeUzNIXkmqjgCQyS3e0irE=", + "dev": true + }, + "kleur": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.3.tgz", + "integrity": "sha512-H1tr8QP2PxFTNwAFM74Mui2b6ovcY9FoxJefgrwxY+OCJcq01k5nvhf4M/KnizzrJvLRap5STUy7dgDV35iUBw==", + "dev": true + }, + "klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "dev": true + }, + "lightcookie": { + "version": "1.0.25", + "resolved": "https://registry.npmjs.org/lightcookie/-/lightcookie-1.0.25.tgz", + "integrity": "sha512-SrY/+eBPaKAMnsn7mCsoOMZzoQyCyHHHZlFCu2fjo28XxSyCLjlooKiTxyrXTg8NPaHp1YzWi0lcGG1gDi6KHw==", + "dev": true + }, + "matchit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/matchit/-/matchit-1.1.0.tgz", + "integrity": "sha512-+nGYoOlfHmxe5BW5tE0EMJppXEwdSf8uBA1GTZC7Q77kbT35+VKLYJMzVNWCHSsga1ps1tPYFtFyvxvKzWVmMA==", + "dev": true, + "requires": { + "@arr/every": "^1.0.0" + } + }, + "mime-lite": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/mime-lite/-/mime-lite-1.0.3.tgz", + "integrity": "sha512-V85l97zJSTG8FEvmdTlmNYb0UMrVBwvRjw7bWTf/aT6KjFwtz3iTz8D2tuFIp7lwiaO2C5ecnrEmSkkMRCrqVw==", + "dev": true + }, + "mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true + }, + "openapi-fuzzer-core": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/openapi-fuzzer-core/-/openapi-fuzzer-core-1.0.6.tgz", + "integrity": "sha512-FJNJIfgUFuv4NmVGq9MYdoKra2GrkDy2uhIjE2YGlw30UA1glf4SXLMhI4UwdcJ8jisKdIxi7lXrfej8GvNW5w==", + "dev": true, + "requires": { + "klona": "^2.0.4" + } + }, + "pactum": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/pactum/-/pactum-3.5.1.tgz", + "integrity": "sha512-7DcbzGFZkvpdETtyxyB5inhmxFhXh+D/AZwF8fQaxywums4zf1nZO/vNDueogN8UWV1YldUEkuGo+1XlGvz+iQ==", + "dev": true, + "requires": { + "@exodus/schemasafe": "^1.2.3", + "deep-override": "^1.0.2", + "form-data-lite": "^1.0.3", + "json-query": "^2.2.2", + "klona": "^2.0.6", + "lightcookie": "^1.0.25", + "openapi-fuzzer-core": "^1.0.6", + "pactum-matchers": "^1.1.6", + "parse-graphql": "^1.0.0", + "phin": "^3.7.0", + "polka": "^0.5.2" + } + }, + "pactum-matchers": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/pactum-matchers/-/pactum-matchers-1.1.6.tgz", + "integrity": "sha512-55io32NeOKbLpHKKPzYDOr+N2dseTzMbj1Gj1y+zvOkKK6NDf5BT5pxglfqLN/ra3ig5zvbrKFUqZIWjAWboog==", + "dev": true + }, + "parse-graphql": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-graphql/-/parse-graphql-1.0.0.tgz", + "integrity": "sha512-NjvQHHaiPCxPZrhm/kKnorxOv7r/eA+tE0VW5E8iJMH9wTqFA1V0YK/7nbpxVu3JdXUxyWTKMez9lsHUtAwa0w==", + "dev": true + }, + "phin": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/phin/-/phin-3.7.0.tgz", + "integrity": "sha512-DqnVNrpYhKGBZppNKprD+UJylMeEKOZxHgPB+ZP6mGzf3uA2uox4Ep9tUm+rUc8WLIdHT3HcAE4X8fhwQA9JKg==", + "requires": { + "centra": "^2.6.0" + } + }, + "polka": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/polka/-/polka-0.5.2.tgz", + "integrity": "sha512-FVg3vDmCqP80tOrs+OeNlgXYmFppTXdjD5E7I4ET1NjvtNmQrb1/mJibybKkb/d4NA7YWAr1ojxuhpL3FHqdlw==", + "dev": true, + "requires": { + "@polka/url": "^0.5.0", + "trouter": "^2.0.1" + } + }, + "sade": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", + "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", + "dev": true, + "requires": { + "mri": "^1.1.0" + } + }, + "trouter": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/trouter/-/trouter-2.0.1.tgz", + "integrity": "sha512-kr8SKKw94OI+xTGOkfsvwZQ8mWoikZDd2n8XZHjJVZUARZT+4/VV6cacRS6CLsH9bNm+HFIPU1Zx4CnNnb4qlQ==", + "dev": true, + "requires": { + "matchit": "^1.0.0" + } + }, + "uvu": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/uvu/-/uvu-0.5.6.tgz", + "integrity": "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==", + "dev": true, + "requires": { + "dequal": "^2.0.0", + "diff": "^5.0.0", + "kleur": "^4.0.3", + "sade": "^1.7.3" + } + } + } +} diff --git a/package.json b/package.json index 7942ddf..fd5d329 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/leelaprasadv/pactum-swagger-coverage.git" + "url": "git+https://github.com/pactumjs/pactum-swagger-coverage.git" }, "keywords": [ "pactum", @@ -22,18 +22,18 @@ "author": "LeelaPrasad ", "license": "MIT", "bugs": { - "url": "https://github.com/leelaprasadv/pactum-swagger-coverage/issues" + "url": "https://github.com/pactumjs/pactum-swagger-coverage/issues" }, - "homepage": "https://github.com/leelaprasadv/pactum-swagger-coverage#readme", + "homepage": "https://github.com/pactumjs/pactum-swagger-coverage#readme", "devDependencies": { - "pactum": "^3.1.12", - "uvu": "^0.5.4" + "pactum": "^3.5.1", + "uvu": "^0.5.6" }, "dependencies": { "js-yaml": "^4.1.0", - "phin": "^3.6.1" + "phin": "^3.7.0" }, "engines": { - "node": ">=8" + "node": ">=10" } } diff --git a/tests/spec.test copy.js.bak b/tests/spec.test copy.js.bak new file mode 100644 index 0000000..e60c7db --- /dev/null +++ b/tests/spec.test copy.js.bak @@ -0,0 +1,129 @@ +const test = require('uvu').test; +const assert = require('uvu/assert'); +const pactum = require('pactum'); +const reporter = pactum.reporter; +const mock = pactum.mock; +const request = pactum.request; +const handler = pactum.handler; + +const psc = require('../src/index'); + +test.before(() => { + psc.swaggerYamlPath = './tests/testObjects/swagger.yaml'; + psc.file = 'report.json' + reporter.add(psc); + request.setBaseUrl('http://localhost:9393'); + handler.addInteractionHandler('get all ninjas', () => { + return { + request: { + method: 'GET', + path: '/api/server/v1/getallninjas' + }, + response: { + status: 200 + } + } + }); + handler.addInteractionHandler('get ninjas by rank', (ctx) => { + return { + request: { + method: 'GET', + path: `/api/server/v1/getninjas/${ctx.data}` + }, + response: { + status: 200 + } + } + }); + handler.addInteractionHandler('get ninja by rank and name', (ctx) => { + return { + request: { + method: 'GET', + path: `/api/server/v1/getninja/${ctx.data.rank}/${ctx.data.name}` + }, + response: { + status: 200 + } + } + }); + + handler.addInteractionHandler('get health', () => { + return { + request: { + method: 'GET', + path: `/api/server/v1/health` + }, + response: { + status: 200 + } + } + }); + return mock.start(); +}); + +test.after(() => { + return mock.stop(); +}); + +test('spec passed', async () => { + await pactum.spec() + .useInteraction('get all ninjas') + .get('/api/server/v1/getallninjas') + .expectStatus(200); +}); + +test('spec passed - additional path params', async () => { + await pactum.spec() + .useInteraction('get ninjas by rank', "jounin") + .get('/api/server/v1/getninjas/jounin') + .expectStatus(200); +}); + +test('spec passed - no path params', async () => { + await pactum.spec() + .useInteraction('get health') + .get('/api/server/v1/health') + .expectStatus(200); +}); + +test('spec passed - different api path with path params', async () => { + await pactum.spec() + .useInteraction('get ninja by rank and name', {rank: "jounin", name: "kakashi"}) + .get('/api/server/v1/getninja/jounin/kakashi') + .expectStatus(200); +}); + +test('spec failed', async () => { + try { + await pactum.spec() + .get('/api/server/v1/getallninjas') + .expectStatus(200); + } catch (error) { + console.log(error); + } +}); + +test('run reporter', async () => { + await reporter.end(); +}); + +test('validate json reporter', async () => { + const report = require('../reports/report.json'); + console.log(JSON.stringify(report, null, 2)); + assert.equal(Object.keys(report).length, 7); + assert.equal(report.hasOwnProperty("basePath"), true) + assert.equal(report.hasOwnProperty("coverage"), true) + assert.equal(report.hasOwnProperty("coveredApiCount"), true) + assert.equal(report.hasOwnProperty("missedApiCount"), true) + assert.equal(report.hasOwnProperty("totalApiCount"), true) + assert.equal(report.hasOwnProperty("coveredApiList"), true) + assert.equal(report.hasOwnProperty("missedApiList"), true) + assert.equal(report.coverage, 0.6666666666666666); + assert.equal(report.coveredApiCount, 4); + assert.equal(report.missedApiCount, 2); + assert.equal(report.totalApiCount, 6); + assert.equal(report.coveredApiList.length, 4); + assert.equal(report.missedApiList.length, 2); +}); + +test.run(); \ No newline at end of file From 25e37bc5e0ecf5fea1e96bb2fa527e1776c9833b Mon Sep 17 00:00:00 2001 From: Leela Prasad <47483946+leelaprasadv@users.noreply.github.com> Date: Sun, 10 Sep 2023 13:37:33 +0530 Subject: [PATCH 2/3] remove unnecessary files --- tests/spec.test copy.js.bak | 129 ------------------------------------ 1 file changed, 129 deletions(-) delete mode 100644 tests/spec.test copy.js.bak diff --git a/tests/spec.test copy.js.bak b/tests/spec.test copy.js.bak deleted file mode 100644 index e60c7db..0000000 --- a/tests/spec.test copy.js.bak +++ /dev/null @@ -1,129 +0,0 @@ -const test = require('uvu').test; -const assert = require('uvu/assert'); -const pactum = require('pactum'); -const reporter = pactum.reporter; -const mock = pactum.mock; -const request = pactum.request; -const handler = pactum.handler; - -const psc = require('../src/index'); - -test.before(() => { - psc.swaggerYamlPath = './tests/testObjects/swagger.yaml'; - psc.file = 'report.json' - reporter.add(psc); - request.setBaseUrl('http://localhost:9393'); - handler.addInteractionHandler('get all ninjas', () => { - return { - request: { - method: 'GET', - path: '/api/server/v1/getallninjas' - }, - response: { - status: 200 - } - } - }); - handler.addInteractionHandler('get ninjas by rank', (ctx) => { - return { - request: { - method: 'GET', - path: `/api/server/v1/getninjas/${ctx.data}` - }, - response: { - status: 200 - } - } - }); - handler.addInteractionHandler('get ninja by rank and name', (ctx) => { - return { - request: { - method: 'GET', - path: `/api/server/v1/getninja/${ctx.data.rank}/${ctx.data.name}` - }, - response: { - status: 200 - } - } - }); - - handler.addInteractionHandler('get health', () => { - return { - request: { - method: 'GET', - path: `/api/server/v1/health` - }, - response: { - status: 200 - } - } - }); - return mock.start(); -}); - -test.after(() => { - return mock.stop(); -}); - -test('spec passed', async () => { - await pactum.spec() - .useInteraction('get all ninjas') - .get('/api/server/v1/getallninjas') - .expectStatus(200); -}); - -test('spec passed - additional path params', async () => { - await pactum.spec() - .useInteraction('get ninjas by rank', "jounin") - .get('/api/server/v1/getninjas/jounin') - .expectStatus(200); -}); - -test('spec passed - no path params', async () => { - await pactum.spec() - .useInteraction('get health') - .get('/api/server/v1/health') - .expectStatus(200); -}); - -test('spec passed - different api path with path params', async () => { - await pactum.spec() - .useInteraction('get ninja by rank and name', {rank: "jounin", name: "kakashi"}) - .get('/api/server/v1/getninja/jounin/kakashi') - .expectStatus(200); -}); - -test('spec failed', async () => { - try { - await pactum.spec() - .get('/api/server/v1/getallninjas') - .expectStatus(200); - } catch (error) { - console.log(error); - } -}); - -test('run reporter', async () => { - await reporter.end(); -}); - -test('validate json reporter', async () => { - const report = require('../reports/report.json'); - console.log(JSON.stringify(report, null, 2)); - assert.equal(Object.keys(report).length, 7); - assert.equal(report.hasOwnProperty("basePath"), true) - assert.equal(report.hasOwnProperty("coverage"), true) - assert.equal(report.hasOwnProperty("coveredApiCount"), true) - assert.equal(report.hasOwnProperty("missedApiCount"), true) - assert.equal(report.hasOwnProperty("totalApiCount"), true) - assert.equal(report.hasOwnProperty("coveredApiList"), true) - assert.equal(report.hasOwnProperty("missedApiList"), true) - assert.equal(report.coverage, 0.6666666666666666); - assert.equal(report.coveredApiCount, 4); - assert.equal(report.missedApiCount, 2); - assert.equal(report.totalApiCount, 6); - assert.equal(report.coveredApiList.length, 4); - assert.equal(report.missedApiList.length, 2); -}); - -test.run(); \ No newline at end of file From 48ba2582bebdfdf914ea4e9740fd33ccc25e1044 Mon Sep 17 00:00:00 2001 From: Leela Prasad <47483946+leelaprasadv@users.noreply.github.com> Date: Sun, 17 Sep 2023 15:21:35 +0530 Subject: [PATCH 3/3] Update publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7c5cd16..766369e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,4 +16,4 @@ jobs: - run: npm test - run: npm publish env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_SW_TOKEN }}