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

Fixes tests and deprecation warnings for Dart2 #9

Merged
merged 5 commits into from
Mar 21, 2018

Conversation

pulyaevskiy
Copy link
Contributor

No description provided.

@pulyaevskiy
Copy link
Contributor Author

Build failed on stable Dart 1.24. Not sure if the library expected to support 1.x. Looks like it targets Flutter which is all-in with Dart2.

@Hixie
Copy link

Hixie commented Mar 20, 2018

cc @yjbanov

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for the upgrade!

when(httpMock.post(any, headers: any, body: any))
.thenAnswer((Invocation invocation) {
httpMock.answerWith((Invocation invocation) {
if (invocation.memberName == #close) return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we assert after this line that memberName is #post? Also, let's use { } for the if block so that the return statement gets its own line.

@@ -128,8 +127,7 @@ void main() {
final MockClient httpMock = new MockClient();
final Clock fakeClock = new Clock.fixed(new DateTime(2017, 1, 2));

when(httpMock.post(any, headers: any, body: any))
.thenAnswer((Invocation invocation) {
httpMock.answerWith((Invocation invocation) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here we can also assert that only post is being called.

# Temporary workaround until Pub supports --preview-dart-2 flag
set -e
for filename in test/*_test.dart; do
dart --preview-dart-2 --enable_asserts "$filename"
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's echo the name of the file we're running. Alternatively, set -x should have roughly the same effect.

@pulyaevskiy
Copy link
Contributor Author

Thanks for taking a look! All comments should be addressed now.

@yjbanov
Copy link
Contributor

yjbanov commented Mar 20, 2018

This makes Dart 1 sad. Here's the plan. How about we do this PR first: #11. Then in this PR, we'll bump the version number to 2.0.0. From then on, if you are Dart 1, you have to use a version <2.0.0, and if you are on Dart 2, then you use version >=2.0.0. WDYT?

@pulyaevskiy
Copy link
Contributor Author

Yeah, sgtm! Maybe also tag 1.0.0 so that it’s easier to backport any fixes, as a suggestion.

@yjbanov
Copy link
Contributor

yjbanov commented Mar 20, 2018

I was about to tag it, then realized I forgot to update the changelog (#12)

@yjbanov
Copy link
Contributor

yjbanov commented Mar 20, 2018

Ok, tagged as https:/flutter/sentry/releases/tag/1.0.0

@yjbanov
Copy link
Contributor

yjbanov commented Mar 20, 2018

So here's the TODO list for this PR:

  • bump version number to 2.0.0
  • create a new entry in CHANGELOG.md

@pulyaevskiy
Copy link
Contributor Author

Just pushed updates.
.travis.yml might need to be updated as well to exclude stable.

@yjbanov
Copy link
Contributor

yjbanov commented Mar 21, 2018

Thanks for fixing this! LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants