Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
Add on to prettier with pretty-quick
Dmitry Yankowskid39b19078851
diff --git a/.huskyrc b/.huskyrcindex 73c98cc98..2543db718 100644--- a/.huskyrc+++ b/.huskyrc@@ -1,5 +1,5 @@{"hooks": {- "pre-commit": "npm run prettier"+ "pre-commit": "npm run pretty-quick"}}\ No newline at end of filediff --git a/package-lock.json b/package-lock.jsonindex 1b1f36617..e4d7ce096 100644--- a/package-lock.json+++ b/package-lock.json@@ -1860,6 +1860,12 @@"resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.1.tgz","integrity": "sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w=="},+ "@types/minimatch": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",+ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",+ "dev": true+ },"@types/node": {"version": "12.12.17","resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.17.tgz",@@ -2384,6 +2390,12 @@"resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz","integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ="},+ "array-differ": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",+ "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",+ "dev": true+ },"array-find-index": {"version": "1.0.2","resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz",@@ -2395,11 +2407,23 @@"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz","integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="},+ "array-union": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",+ "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",+ "dev": true+ },"array-unique": {"version": "0.3.2","resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz","integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg="},+ "arrify": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",+ "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",+ "dev": true+ },"ascli": {"version": "1.0.1","resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.1.tgz",@@ -8312,11 +8336,30 @@"run-queue": "^1.0.3"}},+ "mri": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz",+ "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==",+ "dev": true+ },"ms": {"version": "2.1.2","resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz","integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="},+ "multimatch": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-4.0.0.tgz",+ "integrity": "sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==",+ "dev": true,+ "requires": {+ "@types/minimatch": "^3.0.3",+ "array-differ": "^3.0.0",+ "array-union": "^2.1.0",+ "arrify": "^2.0.1",+ "minimatch": "^3.0.4"+ }+ },"mustache": {"version": "2.3.2","resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.2.tgz",@@ -10139,6 +10182,144 @@"utila": "~0.4"}},+ "pretty-quick": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/pretty-quick/-/pretty-quick-2.0.1.tgz",+ "integrity": "sha512-y7bJt77XadjUr+P1uKqZxFWLddvj3SKY6EU4BuQtMxmmEFSMpbN132pUWdSG1g1mtUfO0noBvn7wBf0BVeomHg==",+ "dev": true,+ "requires": {+ "chalk": "^2.4.2",+ "execa": "^2.1.0",+ "find-up": "^4.1.0",+ "ignore": "^5.1.4",+ "mri": "^1.1.4",+ "multimatch": "^4.0.0"+ },+ "dependencies": {+ "cross-spawn": {+ "version": "7.0.1",+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz",+ "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==",+ "dev": true,+ "requires": {+ "path-key": "^3.1.0",+ "shebang-command": "^2.0.0",+ "which": "^2.0.1"+ }+ },+ "execa": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/execa/-/execa-2.1.0.tgz",+ "integrity": "sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw==",+ "dev": true,+ "requires": {+ "cross-spawn": "^7.0.0",+ "get-stream": "^5.0.0",+ "is-stream": "^2.0.0",+ "merge-stream": "^2.0.0",+ "npm-run-path": "^3.0.0",+ "onetime": "^5.1.0",+ "p-finally": "^2.0.0",+ "signal-exit": "^3.0.2",+ "strip-final-newline": "^2.0.0"+ }+ },+ "find-up": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",+ "dev": true,+ "requires": {+ "locate-path": "^5.0.0",+ "path-exists": "^4.0.0"+ }+ },+ "get-stream": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz",+ "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==",+ "dev": true,+ "requires": {+ "pump": "^3.0.0"+ }+ },+ "is-stream": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",+ "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",+ "dev": true+ },+ "locate-path": {+ "version": "5.0.0",+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",+ "dev": true,+ "requires": {+ "p-locate": "^4.1.0"+ }+ },+ "npm-run-path": {+ "version": "3.1.0",+ "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-3.1.0.tgz",+ "integrity": "sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg==",+ "dev": true,+ "requires": {+ "path-key": "^3.0.0"+ }+ },+ "p-finally": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz",+ "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==",+ "dev": true+ },+ "p-locate": {+ "version": "4.1.0",+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",+ "dev": true,+ "requires": {+ "p-limit": "^2.2.0"+ }+ },+ "path-exists": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",+ "dev": true+ },+ "path-key": {+ "version": "3.1.1",+ "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",+ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",+ "dev": true+ },+ "shebang-command": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",+ "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",+ "dev": true,+ "requires": {+ "shebang-regex": "^3.0.0"+ }+ },+ "shebang-regex": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",+ "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",+ "dev": true+ },+ "which": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",+ "dev": true,+ "requires": {+ "isexe": "^2.0.0"+ }+ }+ }+ },"pretty-time": {"version": "1.1.0","resolved": "https://registry.npmjs.org/pretty-time/-/pretty-time-1.1.0.tgz",diff --git a/package.json b/package.jsonindex 4a5b6777b..80f59be06 100644--- a/package.json+++ b/package.json@@ -15,7 +15,7 @@"e2e": "cypress run","e2e:open": "cypress open","dev:e2e": "server-test dev :3000 e2e:open",- "prettier": "prettier --write **/*.{html,js,json,vue}",+ "pretty-quick": "pretty-quick --pattern \"**/*.*(html|js|json|vue)\"","test": "start-server-and-test start http-get://localhost:3000 e2e"},"dependencies": {@@ -45,6 +45,7 @@"lint-staged": "^10.0.7","node-sass": "^4.13.1","prettier": "^1.19.1",+ "pretty-quick": "^2.0.1","sass-loader": "^8.0.2","start-server-and-test": "^1.10.8"}diff --git a/tests/e2e/integration/proxy.spec.js b/tests/e2e/integration/proxy.spec.jsindex d2d202cb6..5c7184855 100644--- a/tests/e2e/integration/proxy.spec.js+++ b/tests/e2e/integration/proxy.spec.js@@ -1,21 +1,26 @@-describe('Proxy disabled - local request', () => {- it('Change default url with query and make a request to local cat api', () => {- cy.seedAndVisit('catapi', '/?url=https://api.thecatapi.com&path=')- .get('#url').then((el) => expect(el.val() === 'https://api.thecatapi.com').to.equal(true))- .get("#path").then((el) => expect(el.val() === '').to.equal(true))- .get('#response-details-wrapper').should($wrapper => {- expect($wrapper).to.contain('FAKE Cat API')+describe("Proxy disabled - local request", () => {+ it("Change default url with query and make a request to local cat api", () => {+ cy.seedAndVisit("catapi", "/?url=https://api.thecatapi.com&path=")+ .get("#url")+ .then(el => expect(el.val() === "https://api.thecatapi.com").to.equal(true))+ .get("#path")+ .then(el => expect(el.val() === "").to.equal(true))+ .get("#response-details-wrapper")+ .should($wrapper => {+ expect($wrapper).to.contain("FAKE Cat API")})})})-describe('Proxy enabled - external request', () => {- it('Enable the proxy and make a request to the real cat api', () => {- cy.enableProxy('/?url=https://api.thecatapi.com&path=')- .get('#send').click()+describe("Proxy enabled - external request", () => {+ it("Enable the proxy and make a request to the real cat api", () => {+ cy.enableProxy("/?url=https://api.thecatapi.com&path=")+ .get("#send")+ .click().wait(500)- .get('#response-details-wrapper').should($wrapper => {- expect($wrapper).to.contain('Cat API')+ .get("#response-details-wrapper")+ .should($wrapper => {+ expect($wrapper).to.contain("Cat API")})})-})\ No newline at end of file+})