Reject promise if test is skipped via async method#13665
Reject promise if test is skipped via async method#13665christian-bromann merged 2 commits intowebdriverio:mainfrom
Conversation
| if (/^=> marked Pending/.test(e)) { | ||
| return reject(e) | ||
| if (rejectIfSkipped(e, reject)) { | ||
| return |
There was a problem hiding this comment.
Shouldn't it be
| return | |
| return reject() |
if we just return, the promise doesn't get resolve at all, right?
There was a problem hiding this comment.
The reject will be called in rejectIfSkipped. So a simple return should imho be sufficient here.
eslint-plugin-wdio
@wdio/allure-reporter
@wdio/appium-service
@wdio/browserstack-service
@wdio/browser-runner
@wdio/cli
@wdio/concise-reporter
@wdio/config
@wdio/cucumber-framework
@wdio/dot-reporter
@wdio/firefox-profile-service
@wdio/json-reporter
@wdio/jasmine-framework
@wdio/globals
@wdio/junit-reporter
@wdio/lighthouse-service
@wdio/local-runner
@wdio/logger
@wdio/mocha-framework
@wdio/protocols
@wdio/repl
@wdio/reporter
@wdio/runner
@wdio/shared-store-service
@wdio/sauce-service
@wdio/smoke-test-cjs-service
@wdio/smoke-test-reporter
@wdio/smoke-test-service
@wdio/sumologic-reporter
@wdio/static-server-service
@wdio/spec-reporter
@wdio/types
@wdio/testingbot-service
@wdio/utils
webdriver
@wdio/webdriver-mock-service
webdriverio
commit: |
christian-bromann
left a comment
There was a problem hiding this comment.
Makes sense, LGTM 👍
|
Hey sebastian-sauer 👋 Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution. We've sent you an email with further instructions on how to claim your expenses from our development fund. We are looking forward to more contributions from you in the future 🙌 Have a nice day, |
Proposed changes
Reject instead of always resolving.
closes #13620
Types of changes
Checklist
Backport Request
//: # (The current
mainbranch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against thev8branch.)v9and doesn't need to be back-ported#XXXXXFurther comments
Reviewers: @webdriverio/project-committers