From 642ec4140641fa4040ac9e109eeb1a4057f7e69c Mon Sep 17 00:00:00 2001 From: Matt Schile Date: Thu, 6 Jan 2022 14:26:03 -0700 Subject: [PATCH] fix: retrieve 'exit' from config instead of options (#19567) --- packages/server/README.md | 4 ++-- packages/server/lib/modes/run.js | 4 +--- packages/server/test/unit/modes/run_spec.js | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/packages/server/README.md b/packages/server/README.md index 85c879d19829..eac7f68fee90 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -48,7 +48,7 @@ yarn test-watch /test/path/to/spec.js ### Running individual unit tests -```bashtest-kitchensink +```bash yarn test yarn test test/unit/api_spec.js ## or @@ -68,7 +68,7 @@ yarn test-integration cli_spec ## shorthand, uses globbing to find spec > With the addition of Component Testing, `e2e` tests have been renamed to `system-tests` and moved to the [`system-tests`](../../system-tests) directory. -### Updating snaphots +### Updating snapshots Prepend `SNAPSHOT_UPDATE=1` to any test command. See [`snap-shot-it` instructions](https://github.com/bahmutov/snap-shot-it#advanced-use) for more info. diff --git a/packages/server/lib/modes/run.js b/packages/server/lib/modes/run.js index fee65362da7a..59d8b2fc87f7 100644 --- a/packages/server/lib/modes/run.js +++ b/packages/server/lib/modes/run.js @@ -1428,7 +1428,6 @@ module.exports = { }) if (browser.family !== 'chromium' && !options.config.chromeWebSecurity) { - console.log() errors.warning('CHROME_WEB_SECURITY_NOT_SUPPORTED', browser.family) } @@ -1460,7 +1459,7 @@ module.exports = { compressedVideoName: videoRecordProps.compressedVideoName, endVideoCapture: videoRecordProps.endVideoCapture, startedVideoCapture: videoRecordProps.startedVideoCapture, - exit: options.exit, + exit: config.exit, videoCompression: options.videoCompression, videoUploadOnPasses: options.videoUploadOnPasses, quiet: options.quiet, @@ -1608,7 +1607,6 @@ module.exports = { video: config.video, videoCompression: config.videoCompression, videoUploadOnPasses: config.videoUploadOnPasses, - exit: options.exit, headed: options.headed, quiet: options.quiet, outputPath: options.outputPath, diff --git a/packages/server/test/unit/modes/run_spec.js b/packages/server/test/unit/modes/run_spec.js index ba7decd82a53..d6180dc590e0 100644 --- a/packages/server/test/unit/modes/run_spec.js +++ b/packages/server/test/unit/modes/run_spec.js @@ -810,6 +810,21 @@ describe('lib/modes/run', () => { }) }) + it('passes exit from config to waitForTestsToFinishRunning', function () { + this.projectInstance.getConfig.restore() + sinon.stub(this.projectInstance, 'getConfig').resolves({ + proxyUrl: 'http://localhost:12345', + exit: false, + }) + + return runMode.run() + .then(() => { + expect(runMode.waitForTestsToFinishRunning).to.be.calledWithMatch({ + exit: false, + }) + }) + }) + it('passes headed to openProject.launch', () => { const browser = { name: 'electron', family: 'chromium' }