mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
Run tests for builds vs packages using env variable (#2660)
This commit is contained in:
parent
3e7be75a4f
commit
8a6c5cc9b3
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@ -35,6 +35,6 @@ jobs:
|
|||||||
- name: Build designer for smoke tests
|
- name: Build designer for smoke tests
|
||||||
run: npm run app-build:smoke:designer
|
run: npm run app-build:smoke:designer
|
||||||
- name: Run core smoke tests
|
- name: Run core smoke tests
|
||||||
run: npm run test:smoke:core
|
run: npm run test:smoke:core:build
|
||||||
- name: Run designer smoke tests
|
- name: Run designer smoke tests
|
||||||
run: npm run test:smoke:designer
|
run: npm run test:smoke:designer:build
|
||||||
|
@ -27,9 +27,10 @@
|
|||||||
"preinstall": "node ./scripts/check-version.js",
|
"preinstall": "node ./scripts/check-version.js",
|
||||||
"app-build:smoke:core": "cross-env SMOKE_TEST=core npm run app-build",
|
"app-build:smoke:core": "cross-env SMOKE_TEST=core npm run app-build",
|
||||||
"app-build:smoke:designer": "cross-env SMOKE_TEST=designer npm run app-build",
|
"app-build:smoke:designer": "cross-env SMOKE_TEST=designer npm run app-build",
|
||||||
"test:smoke:core": "npm run test:core:build --prefix packages/insomnia-smoke-test",
|
"test:smoke:core:build": "npm run test:core:build --prefix packages/insomnia-smoke-test",
|
||||||
"test:smoke:designer": "npm run test:designer:build --prefix packages/insomnia-smoke-test",
|
"test:smoke:designer:build": "npm run test:designer:build --prefix packages/insomnia-smoke-test",
|
||||||
"test:smoke:package": "npm run test:package --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"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"{packages,plugins}/**/*.{js,json}": [
|
"{packages,plugins}/**/*.{js,json}": [
|
||||||
|
@ -36,19 +36,23 @@ export const launchDesigner = async () => {
|
|||||||
return await launch(config);
|
return await launch(config);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getLaunchPath = config =>
|
||||||
|
process.env.BUNDLE === 'package'
|
||||||
|
? { path: config.packagePath }
|
||||||
|
: {
|
||||||
|
path: electronPath,
|
||||||
|
args: [config.buildPath],
|
||||||
|
};
|
||||||
|
|
||||||
const launch = async config => {
|
const launch = async config => {
|
||||||
if (!config) {
|
if (!config) {
|
||||||
throw new Error('Spectron config could not be loaded.');
|
throw new Error('Spectron config could not be loaded.');
|
||||||
}
|
}
|
||||||
|
|
||||||
const app = new Application({
|
const app = new Application({
|
||||||
// Run after app-package
|
...getLaunchPath(config),
|
||||||
// path: config.packagePath,
|
|
||||||
|
|
||||||
// Run after app-build - mac, Windows, Linux
|
// Don't remove chromeDriverArgs
|
||||||
path: electronPath,
|
|
||||||
args: [config.buildPath],
|
|
||||||
|
|
||||||
// Don't ask why, but don't remove chromeDriverArgs
|
|
||||||
// https://github.com/electron-userland/spectron/issues/353#issuecomment-522846725
|
// https://github.com/electron-userland/spectron/issues/353#issuecomment-522846725
|
||||||
chromeDriverArgs: ['remote-debugging-port=9222'],
|
chromeDriverArgs: ['remote-debugging-port=9222'],
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
"name": "insomnia-smoke-test",
|
"name": "insomnia-smoke-test",
|
||||||
"version": "2.2.25",
|
"version": "2.2.25",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"spectron:core:build": "xvfb-maybe jest --testPathPattern core",
|
"spectron:core:build": "cross-env BUNDLE=build xvfb-maybe jest --testPathPattern core",
|
||||||
"spectron:designer:build": "xvfb-maybe jest --testPathPattern designer",
|
"spectron:designer:build": "cross-env BUNDLE=build xvfb-maybe jest --testPathPattern designer",
|
||||||
"spectron:core:package": "xvfb-maybe jest --testPathPattern core",
|
"spectron:core:package": "cross-env BUNDLE=package xvfb-maybe jest --testPathPattern core",
|
||||||
"spectron:designer:package": "xvfb-maybe jest --testPathPattern designer",
|
"spectron:designer:package": "cross-env BUNDLE=package xvfb-maybe jest --testPathPattern designer",
|
||||||
"start:prism": "prism mock prism/oas3.yaml",
|
"start:prism": "prism mock prism/oas3.yaml",
|
||||||
"with-mock": "concurrently --names prism,spectron --success first --kill-others \"npm run start:prism\"",
|
"with-mock": "concurrently --names prism,spectron --success first --kill-others \"npm run start:prism\"",
|
||||||
"test:core:build": "npm run with-mock \"npm run spectron:core:build\"",
|
"test:core:build": "npm run with-mock \"npm run spectron:core:build\"",
|
||||||
|
Loading…
Reference in New Issue
Block a user