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

feat: return Promises for async Ti.Database.DB methods #12417

Merged
merged 8 commits into from
Jan 26, 2021

Conversation

sgtcoolguy
Copy link
Contributor

@sgtcoolguy sgtcoolguy commented Jan 26, 2021

JIRA: https://jira.appcelerator.org/browse/TIMOB-28279

Description:
Relates to #12349, #12407

This modifies some of our async methods to also return a Promise:

  • Ti.Database.DB.executeAsync()
  • Ti.Database.DB.executeAllAsync()

Unit tests are included!

should(rows.rowCount).be.eql(1);
should(rows.fieldCount).be.eql(3);
should(rows.validRow).be.true();
} finally {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ tests/Resources/ti.database.test.js line 505 – Each then() should return a value or throw (promise/always-return)
  • ⚠️ tests/Resources/ti.database.test.js line 505 – Each then() should return a value or throw (promise/always-return)

@build
Copy link
Contributor

build commented Jan 26, 2021

Fails
🚫 Tests have failed, see below for more information.
Warnings
⚠️

tests/Resources/ti.database.test.js#L484 - tests/Resources/ti.database.test.js line 484 – Expected catch() or return (promise/catch-or-return)

⚠️

tests/Resources/ti.database.test.js#L533 - tests/Resources/ti.database.test.js line 533 – Expected catch() or return (promise/catch-or-return)

⚠️

tests/Resources/ti.database.test.js#L690 - tests/Resources/ti.database.test.js line 690 – Expected catch() or return (promise/catch-or-return)

⚠️

tests/Resources/ti.database.test.js#L776 - tests/Resources/ti.database.test.js line 776 – Expected catch() or return (promise/catch-or-return)

Messages
📖

💾 Here's the generated SDK zipfile.

📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 3 tests have failed There are 3 tests failing and 899 skipped out of 14875 total tests.

Tests:

ClassnameNameTimeError
ios.ipad.Titanium.UI.WebView.userAgent (14.0.0)60
Error: timeout of 60000ms exceeded
file:///ti-mocha.js:4290:32
ios.iphone.Titanium.UI.WebView.userAgent (14.0.0)60.001
Error: timeout of 60000ms exceeded
file:///ti-mocha.js:4290:32
ios.macos.Titanium.UI.WebView.userAgent (10.15.5)60.063
Error: timeout of 60000ms exceeded
file:///ti-mocha.js:4290:32

Generated by 🚫 dangerJS against 3402a6d

should(rows.rowCount).be.eql(1);
should(rows.fieldCount).be.eql(3);
should(rows.validRow).be.true();
} finally {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ tests/Resources/ti.database.test.js line 701 – Each then() should return a value or throw (promise/always-return)
  • ⚠️ tests/Resources/ti.database.test.js line 701 – Each then() should return a value or throw (promise/always-return)

@sgtcoolguy sgtcoolguy merged commit db4ae74 into tidev:master Jan 26, 2021
@sgtcoolguy sgtcoolguy deleted the db-promises branch January 26, 2021 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants