Skip to content

Commit

Permalink
feat(cli): show environment info in verbose mode (#3858)
Browse files Browse the repository at this point in the history
* feat(cli): show environment info in verbose mode

* fix: UT

* remove .only
  • Loading branch information
kobenguyent authored Sep 15, 2023
1 parent 7feea6b commit 2ac4afb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/command/run-workers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions lib/command/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/runner/timeout_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2ac4afb

Please sign in to comment.