From 2ac4afbd501243e6823a54983adca0ce9456a1c4 Mon Sep 17 00:00:00 2001 From: KobeNguyenT <7845001+kobenguyent@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:36:42 +0200 Subject: [PATCH] feat(cli): show environment info in verbose mode (#3858) * feat(cli): show environment info in verbose mode * fix: UT * remove .only --- lib/command/run-workers.js | 4 ++++ lib/command/run.js | 6 ++++++ test/runner/timeout_test.js | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/command/run-workers.js b/lib/command/run-workers.js index 378361c8c..be1a3dc85 100644 --- a/lib/command/run-workers.js +++ b/lib/command/run-workers.js @@ -39,6 +39,10 @@ module.exports = async function (workerCount, selectedRuns, options) { }); try { + if (options.verbose) { + const getInfo = require('./info'); + await getInfo(); + } await workers.bootstrapAll(); await workers.run(); } catch (err) { diff --git a/lib/command/run.js b/lib/command/run.js index 4921ea03c..fba9b3a68 100644 --- a/lib/command/run.js +++ b/lib/command/run.js @@ -28,6 +28,12 @@ module.exports = async function (test, options) { codecept.init(testRoot); await codecept.bootstrap(); codecept.loadTests(test); + + if (options.verbose) { + const getInfo = require('./info'); + await getInfo(); + } + await codecept.run(); } catch (err) { printError(err); diff --git a/test/runner/timeout_test.js b/test/runner/timeout_test.js index 58a2d8af1..8e14efc09 100644 --- a/test/runner/timeout_test.js +++ b/test/runner/timeout_test.js @@ -67,7 +67,7 @@ describe('CodeceptJS Timeouts', function () { }); it('should override timeout config from global object', (done) => { - exec(config_run_config('codecept.timeout.obj.conf.js', '#first', true), (err, stdout) => { + exec(config_run_config('codecept.timeout.obj.conf.js', '#first', false), (err, stdout) => { debug_this_test && console.log(stdout); expect(stdout).toContain('Timeout 0.3s exceeded'); expect(err).toBeTruthy();