Introduce E2E tests for inso run test (#2917)

This commit is contained in:
Opender Singh authored and GitHub committed 2020-12-08 13:03:06 +13:00
1 parent 98d2cf90c7
commit fa4306c5d8
12 files changed
+168 -37

No files matched your search

+2
View File
@@ -40,3 +40,5 @@ jobs:
- name: Run designer smoke tests
timeout-minutes: 10 # sometimes jest fails to exit - https://github.com/facebook/jest/issues/6423#issuecomment-620407580
run: npm run test:smoke:designer:build
- name: Run CLI smoke tests
run: npm run test:smoke:cli
+2 -1
View File
@@ -32,7 +32,8 @@
"test:smoke:core:build": "npm run test:core:build --prefix packages/insomnia-smoke-test",
"test:smoke:designer:build": "npm run test:designer:build --prefix packages/insomnia-smoke-test",
"test:smoke:core:package": "npm run test:core:package --prefix packages/insomnia-smoke-test",
"test:smoke:designer:package": "npm run test:designer:package --prefix packages/insomnia-smoke-test"
"test:smoke:designer:package": "npm run test:designer:package --prefix packages/insomnia-smoke-test",
"test:smoke:cli": "npm run test:cli --prefix packages/insomnia-smoke-test"
},
"lint-staged": {
"{packages,plugins}/**/*.{js,json}": [
@@ -0,0 +1,12 @@
import execa from 'execa';
import { getBinPathSync } from 'get-bin-path';
describe('run test', () => {
it('can run unit test', () => {
const command = 'run test -a fixtures/inso-nedb TestSuite -e Dev';
const { failed } = execa.sync(getBinPathSync({ cwd: '../insomnia-inso' }), command.split(' '));
expect(failed).toBe(false);
});
});
@@ -0,0 +1 @@
{"_id":"spc_3703e60a16684b0ba1fabe734fbff005","type":"ApiSpec","parentId":"wrk_41a42f72882a483ba2bc92c908ac27a9","modified":1607311761330,"created":1607311536124,"fileName":"Document","contents":"","contentType":"yaml"}
@@ -0,0 +1,2 @@
{"_id":"env_28ef07475f8a3c570164d300b54834d4210556df","type":"Environment","parentId":"wrk_41a42f72882a483ba2bc92c908ac27a9","modified":1607312114703,"created":1607311536150,"name":"Base Environment","data":{"base_url":""},"dataPropertyOrder":{"&":["base_url"]},"color":null,"isPrivate":false,"metaSortKey":1607311536150}
{"_id":"env_baf32bd57d0e45f38e3914e51d2f0c29","type":"Environment","parentId":"env_28ef07475f8a3c570164d300b54834d4210556df","modified":1607312133614,"created":1607312095708,"name":"Dev","data":{"base_url":"http://localhost:4010"},"dataPropertyOrder":{"&":["base_url"]},"color":null,"isPrivate":false,"metaSortKey":1607312095708}
@@ -0,0 +1 @@
{"_id":"req_5a77fa051cae441783d6e20a364a60f7","type":"Request","parentId":"wrk_41a42f72882a483ba2bc92c908ac27a9","modified":1607311796833,"created":1607311548694,"url":"{{ _.base_url }}/pets/1","name":"My Request","description":"","method":"GET","body":{},"parameters":[],"headers":[],"authentication":{},"metaSortKey":-1607311548694,"isPrivate":false,"settingStoreCookies":true,"settingSendCookies":true,"settingDisableRenderRequestBody":false,"settingEncodeUrl":true,"settingRebuildPath":true,"settingFollowRedirects":"global"}
Whitespace-only changes.
@@ -0,0 +1 @@
{"_id":"ut_d9e46e1fae344232991d1724124480ee","type":"UnitTest","parentId":"uts_db079ef8d1a74a7da6158175ebd89b00","modified":1607311749442,"created":1607311745076,"requestId":"req_5a77fa051cae441783d6e20a364a60f7","name":"Returns 200","code":"const response = await insomnia.send();\nexpect(response.status).to.equal(200);\nexpect(JSON.parse(response.data).id).to.equal('1')"}
@@ -0,0 +1 @@
{"_id":"uts_db079ef8d1a74a7da6158175ebd89b00","type":"UnitTestSuite","parentId":"wrk_41a42f72882a483ba2bc92c908ac27a9","modified":1607311564521,"created":1607311564521,"name":"TestSuite"}
@@ -0,0 +1 @@
{"_id":"wrk_41a42f72882a483ba2bc92c908ac27a9","type":"Workspace","parentId":null,"modified":1607311536124,"created":1607311536124,"name":"Insomnia Designer","description":"","scope":"spec"}
+140 -35
View File
@@ -1998,16 +1998,25 @@
}
},
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"dependencies": {
"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"
}
}
}
},
"css-value": {
@@ -2389,18 +2398,34 @@
"dev": true
},
"execa": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
"integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"dependencies": {
"get-stream": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
"integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==",
"dev": true
},
"human-signals": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true
}
}
},
"exit": {
@@ -2837,6 +2862,16 @@
"integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==",
"dev": true
},
"get-bin-path": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/get-bin-path/-/get-bin-path-5.1.0.tgz",
"integrity": "sha512-TLLKuXME03Sn12Eml4rRxNm+l09dNTxKd4edI7bcAA3ULkHn/TA7UdUg08sx5WA7BMv8sJnnQ2Q2HDawq6uWOQ==",
"dev": true,
"requires": {
"is-plain-obj": "^2.1.0",
"read-pkg-up": "^7.0.1"
}
},
"get-caller-file": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
@@ -3320,6 +3355,12 @@
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
"is-plain-obj": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
"integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
"dev": true
},
"is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
@@ -3336,9 +3377,9 @@
"dev": true
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"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
},
"is-typedarray": {
@@ -4594,12 +4635,12 @@
}
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
"integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==",
"dev": true,
"requires": {
"path-key": "^2.0.0"
"path-key": "^3.0.0"
}
},
"nwsapi": {
@@ -4796,9 +4837,9 @@
"dev": true
},
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"path-parse": {
@@ -5376,6 +5417,34 @@
}
}
},
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.0",
"get-stream": "^4.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
}
},
"fill-range": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
@@ -5419,6 +5488,12 @@
}
}
},
"is-stream": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
"dev": true
},
"micromatch": {
"version": "3.1.10",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
@@ -5449,6 +5524,36 @@
"remove-trailing-separator": "^1.0.1"
}
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
"dev": true,
"requires": {
"path-key": "^2.0.0"
}
},
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
"shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"to-regex-range": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
@@ -5609,18 +5714,18 @@
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"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": "^1.0.0"
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"shellwords": {
+5 -1
View File
@@ -8,8 +8,10 @@
"spectron:designer:build": "cross-env BUNDLE=build xvfb-maybe jest --detectOpenHandles --testPathPattern designer",
"spectron:core:package": "cross-env BUNDLE=package xvfb-maybe jest --detectOpenHandles --testPathPattern core",
"spectron:designer:package": "cross-env BUNDLE=package xvfb-maybe jest --detectOpenHandles --testPathPattern designer",
"cli": "jest --detectOpenHandles --testPathPattern cli",
"serve": "node server/index.js",
"with-mock": "concurrently --names server,spectron --success first --kill-others \"npm run serve\"",
"with-mock": "concurrently --names server,app --success first --kill-others \"npm run serve\"",
"test:cli": "npm run with-mock \"npm run cli\"",
"test:core:build": "npm run with-mock \"npm run spectron:core:build\"",
"test:designer:build": "npm run with-mock \"npm run spectron:designer:build\"",
"test:core:package": "npm run with-mock \"npm run spectron:core:package\"",
@@ -18,9 +20,11 @@
"devDependencies": {
"concurrently": "^5.3.0",
"cross-env": "^7.0.2",
"execa": "^5.0.0",
"express": "^4.17.1",
"express-basic-auth": "^1.2.0",
"faker": "^5.1.0",
"get-bin-path": "^5.1.0",
"jest": "^26.4.2",
"spectron": "^11.1.0",
"spectron-keys": "0.0.1",