Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified globalSetup.ts to make reason and origin of throwBetterErrorMessage more clear #9336

Merged

Conversation

RossVertizan
Copy link
Contributor

Proposed changes

In working with the WebdriverIO testing, I tried to use the ViTest extension to VSCode and when I ran it I got the error message about having to rename "got". I wasn't really sure where it was coming from and because I had successfully run the tests in a terminal decided that it must being caused by the ViTest plugin or VS Code. Then I realised that the tests would not run in my terminal any more and I got the same error.

The key change is to change "We" to "WebdriverIO", which hopefully makes it clearer where the source of the error is. I have also created a separate message for Setup and TearDown and made them slightly more descriptive of what is happening.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

Reviewers: @webdriverio/project-committers

@christian-bromann
Copy link
Member

The key change is to change "We" to "WebdriverIO", which hopefully makes it clearer where the source of the error is.

👍

I have also created a separate message for Setup and TearDown and made them slightly more descriptive of what is happening.

Can we have it so we have less duplicate text, e.g. using util.format:

const ERROR_MESSAGE = '...%s...'
console.log(util.format(ERROR_MESSAGE, 'teardown')

I hope that illustrates the approach I mean.

@RossVertizan
Copy link
Contributor Author

Yep, fair enough.

scripts/test/globalSetup.ts Outdated Show resolved Hide resolved
scripts/test/globalSetup.ts Outdated Show resolved Hide resolved
Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@christian-bromann christian-bromann added the PR: Internal 🏠 PRs that contain changes internals label Dec 6, 2022
@christian-bromann christian-bromann merged commit 99d788e into webdriverio:main Dec 6, 2022
@RossVertizan RossVertizan deleted the ra-got-global-setup branch December 7, 2022 10:08
@RossVertizan
Copy link
Contributor Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Internal 🏠 PRs that contain changes internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants