-
Notifications
You must be signed in to change notification settings - Fork 66
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
Let Jasmine handle promises in tests #169
Labels
Comments
raphinesse
added a commit
to apache/cordova-ios
that referenced
this issue
Oct 29, 2019
raphinesse
changed the title
Let Jasmine handle async test results
Let Jasmine handle promises
Oct 29, 2019
This was referenced Oct 29, 2019
raphinesse
changed the title
Let Jasmine handle promises
Let Jasmine handle promises in tests
Oct 30, 2019
For future reference. You can find all usage of Jasmine's rules:
no-restricted-syntax:
- error
- selector: 'CallExpression[callee.name=it] > :function:nth-child(2) > :first-child'
message: "Jasmine's done is not allowed" |
This was referenced Oct 30, 2019
raphinesse
added a commit
to apache/cordova-plugin-screen-orientation
that referenced
this issue
Nov 21, 2019
* test: let Jasmine handle promises Last in line for apache/cordova#169 * lock in portrait mode to avoid trouble on CI cordova-paramedic runs the SauceLabs CI tests in portrait mode. For the Android 7.0 target, it seemed as our locking to landscape interferes with the Appium driver trying to set the app to portrait orientation. The result is a failure to connect to the device and finally a timeout. To avoid that, we are locking the app into portrait mode instead. * test: verify orientation after locking
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Almost all asynchronous interfaces we provide or work with, make use of Promises. Jasmine has elegant built-in support for handling promises. Nonetheless, most asynchronous legacy tests don't make use of it. Instead, they are using makeshift and often buggy constructs using Jasmine's callback-style asynchronous tests (using the
done
parameter).In many repos the transition to a simpler more robust Promise handling in tests has already been made. This issue should serve as a checklist of the remaining work in this area.
It's also often helpful to make this transition before removing Q (#7) in the given repo.
Of course, there are perfectly acceptable usages of
done
, most notably when working with callback-based async interfaces. But these are the vast minority in our tests.Task list
(only repos that feature or featured usage of
done
)Tools/libs
cordova-js(acceptable usage)Platforms
Plugins
cordova-plugin-battery-status(acceptable usage)cordova-plugin-file(acceptable usage)cordova-plugin-geolocation(acceptable usage)cordova-plugin-inappbrowser(acceptable usage)cordova-plugin-media(acceptable usage)The text was updated successfully, but these errors were encountered: