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

Promise support #807

Merged
merged 116 commits into from
Sep 19, 2017
Merged
Changes from 1 commit
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
371ce94
add Promise support for connect, now connectAsync use promises
Aug 21, 2017
5d358a0
add dropAsync and syncPromise, add test coverage for this methods
Aug 22, 2017
7c01df4
fix code dublication error
Aug 22, 2017
29d7ff1
remove env var from pkg json
Aug 22, 2017
959faed
fix after review
Aug 22, 2017
9f2f298
restore example file, fix after review
Aug 22, 2017
59dc1af
LazyLoad should return Promise
anton-locomote Aug 22, 2017
5dddc62
addLazyLoadProperty function could add async methods to the Instance
anton-locomote Aug 23, 2017
ef15df3
integraion tests updated
anton-locomote Aug 23, 2017
62dcd08
add pingAsync and connectAsync methods, add test for it, update READM…
Aug 23, 2017
97f2281
Fixes for PR comments
anton-locomote Aug 23, 2017
6d95a05
Async methods will use promisify instead new Promise
anton-locomote Aug 29, 2017
5861ad7
Remove code duplicates in promisify methods
anton-locomote Aug 30, 2017
c05863d
Optimized functions names. Added Async prefix in Settings file
anton-locomote Aug 30, 2017
c146c45
Changed properties names in funcNamesObj and Settings.defaults
anton-locomote Aug 30, 2017
40b4315
Renamed funcNamesObj on functionNames
anton-locomote Aug 30, 2017
ae5519d
Changed promiseFunctionPostfix value. Also small fixes
anton-locomote Aug 30, 2017
5c4b67b
Add promise support to association extend
anton-locomote Aug 28, 2017
1eab7e0
Part of Async methods for Association many
anton-locomote Aug 29, 2017
dee4704
Added promisify instead new Promises for Extend Associations. Revert …
anton-locomote Aug 29, 2017
0a08c6f
Added promisify to Manu and One Associations
anton-locomote Aug 31, 2017
607675e
Added changes to Associations Many. Created tests for Associations Ma…
anton-locomote Aug 31, 2017
8d49582
Fixed indentation in Extend.js file
anton-locomote Sep 1, 2017
60ff735
apply Promise.promisify for callbacks transformation, replace tests f…
Sep 4, 2017
d03fe82
closeAsync and pingAsync generates directly from ORM.prototype
Sep 4, 2017
b8a7f9b
fix after review
Sep 4, 2017
9bfd7c8
create eagerQueryAsync, execQueryAsync -> return a Promise
Aug 22, 2017
9a9d771
remove code , change if statement in execQueryAsync
Aug 23, 2017
2547a14
remove Promise variable, align Promise declaration
Aug 23, 2017
6ced670
transform callbacks use promisify
Sep 4, 2017
ad485a2
remove unnecessary variables
Sep 4, 2017
377b1cf
Promisify support in save, validate, remove
anton-locomote Sep 4, 2017
f050b08
Add Promise support for get aggregation.
ramzamzam Sep 4, 2017
d1237fe
add tests
Sep 4, 2017
3511ad7
Optimized function names. Tests created
anton-locomote Sep 4, 2017
03c47ce
Resolved PR comments
anton-locomote Sep 4, 2017
33fd97c
redo getAsync function to resolve array of arguments
ramzamzam Sep 4, 2017
9e335a1
Resolve PR comments: added spaces after brackets
anton-locomote Sep 4, 2017
35895c0
revert unneeded changes
ramzamzam Sep 4, 2017
0c32586
fix getAsync function
ramzamzam Sep 5, 2017
c6aceb0
Add runAsync method for promise support. Create async tests
anton-locomote Sep 5, 2017
6f7d531
add clearAsync, createAsync, getAsync and test for it
Sep 5, 2017
172e2c6
add promise support to hooks
Sep 6, 2017
45553e8
add Promise checking via chack that "then" is a function
Sep 6, 2017
ecc74a4
adjust code style
Sep 8, 2017
4d09077
Fix broken tests
dxg Sep 11, 2017
c43910f
add useAsync and loadAsync
Sep 11, 2017
049d157
Merge pull request #12 from locomote/feature/LM-2668
tttmaximttt Sep 11, 2017
53db079
Promisified neccessary functions
anton-locomote Sep 12, 2017
41a2d6a
Remove success and fail tests
anton-locomote Sep 12, 2017
986606a
add existAsync, oneAsync, findAsync, countAsync methods
Sep 12, 2017
c06df3e
add existAsync, oneAsync, findAsync, countAsync methods
Sep 12, 2017
28ce120
add test for findAsync mapsto
Sep 12, 2017
5f120b6
Resolve PR comments: add postFix to async methods; rewrite tests
anton-locomote Sep 12, 2017
3b332f8
Merge pull request #15 from locomote/feature/lm-2679-promise-support-…
anton-locomote Sep 12, 2017
faf36f1
remove done from tests which use Promise
Sep 12, 2017
6ff98d2
fix test
Sep 12, 2017
7ed9f5f
Merge pull request #16 from locomote/feature/LM-2669
tttmaximttt Sep 12, 2017
69a950d
add Promise support for connect, now connectAsync use promises
Aug 21, 2017
2e93243
restore example file, fix after review
Aug 22, 2017
e04615b
Add Promise support for get aggregation.
ramzamzam Sep 4, 2017
af712b4
Update Async tests (except Hooks)
anton-locomote Sep 5, 2017
ad4eebe
Add changes to the part of tests
anton-locomote Sep 12, 2017
7ad36dc
Add changes to the part of tests
anton-locomote Sep 12, 2017
c0a00ce
Association hasmany async tests moved to separate
anton-locomote Sep 12, 2017
1e38407
update has meny tests
Sep 13, 2017
373398b
Update part of hasone async tests
anton-locomote Sep 13, 2017
175139e
Merge branch 'update/LM-2592-update-autotests-for-promises-support' o…
anton-locomote Sep 13, 2017
ad12886
update db and extend promise test
Sep 13, 2017
6d49ff0
Update part of hasone async tests
anton-locomote Sep 14, 2017
51de675
Merge branch 'update/LM-2592-update-autotests-for-promises-support' o…
anton-locomote Sep 14, 2017
3d352c3
adjust test code style
Sep 14, 2017
ff245cd
add model save async tests
Sep 14, 2017
c1204cc
Tests changes before branch pull
anton-locomote Sep 14, 2017
1baa067
Merge branch 'update/LM-2592-update-autotests-for-promises-support' o…
anton-locomote Sep 14, 2017
dadc444
Final commit for hasone association async tests
anton-locomote Sep 14, 2017
2900c3d
update instance tests
Sep 14, 2017
58404fe
Merge remote-tracking branch 'origin/update/LM-2592-update-autotests-…
Sep 14, 2017
bf6f37e
update ignore files
Sep 14, 2017
1275d84
Add and update lazyload async methods
anton-locomote Sep 14, 2017
f4fbc83
Merge branch 'update/LM-2592-update-autotests-for-promises-support' o…
anton-locomote Sep 14, 2017
bc2d54a
Add hasone-zeroid async tests; Removed test duplicates
anton-locomote Sep 14, 2017
4257227
Reset test config to default
anton-locomote Sep 14, 2017
ec4d526
Resolve PR comments: format some indents; removed done()
anton-locomote Sep 14, 2017
e9a8a1b
Lazyload global scope variable fix
anton-locomote Sep 15, 2017
f30e56a
fix unused vars
Sep 15, 2017
9074005
Merge pull request #10 from locomote/update/LM-2592-update-autotests-…
anton-locomote Sep 18, 2017
0588a99
fix unused vars
Sep 15, 2017
365d714
add promise documentation
Sep 18, 2017
4812448
4.0.0
Sep 18, 2017
4729f59
fix after review
Sep 18, 2017
fda2787
fix after review
Sep 18, 2017
eb49dc8
fix after review
Sep 18, 2017
ad4870a
Merge pull request #17 from locomote/feature/LM-2606
tttmaximttt Sep 18, 2017
ea8f31c
Merge branch 'master' of github.com:locomote/node-orm2
Sep 18, 2017
031075a
add deprecation message for fail and success
Sep 18, 2017
24d6102
add deprecation log message
Sep 18, 2017
7ec05d1
add deprecated promise backward capability
Sep 18, 2017
e41e1b1
Merge pull request #18 from locomote/feature/add-deprecation-message
tttmaximttt Sep 18, 2017
1934b15
Fixed failed mysql tests
anton-locomote Sep 18, 2017
c4e886d
Fix hasone-zeroid-async test according to old test logic
anton-locomote Sep 18, 2017
9e3ea62
Fixed tests according to sync tests logic
anton-locomote Sep 18, 2017
e2da459
Merge pull request #19 from locomote/fix/lm-2855-fix-tests-for-all-dr…
dxg Sep 19, 2017
ffdaba7
skip eagerQuery test for redshift
Sep 19, 2017
80e07d9
Merge pull request #20 from locomote/fix/lm-2855-fix-tests-for-all-dr…
tttmaximttt Sep 19, 2017
a6e7037
fix code duplication
Sep 19, 2017
ea923e3
fix code duplication
Sep 19, 2017
a3a4313
fix if statement
Sep 19, 2017
d14f41b
Merge pull request #21 from locomote/fix/lm-2855-fix-tests-for-all-dr…
tttmaximttt Sep 19, 2017
3fae37a
fix duplication
Sep 19, 2017
b03cea7
fix indentation
Sep 19, 2017
cf61ef0
Merge pull request #22 from locomote/fix/lm-2855-fix-tests-for-all-dr…
tttmaximttt Sep 19, 2017
dc13731
fix indentation
Sep 19, 2017
fdf6f68
Merge pull request #23 from locomote/fix/lm-2855-fix-tests-for-all-dr…
tttmaximttt Sep 19, 2017
b9809a3
fix duplication
Sep 19, 2017
180a389
Merge pull request #24 from locomote/fix/lm-2855-fix-tests-for-all-dr…
tttmaximttt Sep 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed tests according to sync tests logic
  • Loading branch information
anton-locomote committed Sep 18, 2017
commit 9e3ea6223e827ba08d64d02a93ce4f670fc16b62
20 changes: 11 additions & 9 deletions test/integration/association-hasone-reverse-async.js
Original file line number Diff line number Diff line change
@@ -142,23 +142,25 @@ describe("hasOne Async", function () {
it("should be able to find given an association id", function () {
return Person
.findAsync({ name: "John Doe" })
.then(function (John) {
.then(function (persons) {
var John = persons[0];
should.exist(John);
return [John, Pet.findAsync({ name: "Deco" })];
})
.spread(function (John, Deco) {
var Deco = Deco[0];
should.exist(Deco);
return [John[0], Deco[0], Deco[0].hasOwnersAsync()];
return [John, Deco, Deco.hasOwnersAsync()];
})
.spread(function (John, Deco, has_owner) {
has_owner.should.equal(false);
return [John, Deco.setOwnersAsync(John)];
return [John, Deco, Deco.setOwnersAsync(John)];
})
.spread(function (John) {
return [John, Person.findAsync({ pet_id: 1 })];
.spread(function (John, Deco) {
return [John, Person.findAsync({ pet_id: Deco[Pet.id] })];
})
.spread(function (John, owner) {
should.exist(owner[0]);
should.exist(owner);
should.equal(owner[0].name, John.name);
});
});
@@ -178,10 +180,10 @@ describe("hasOne Async", function () {
})
.spread(function (John, Deco, has_owner) {
has_owner.should.equal(false);
return [John, Deco.setOwnersAsync(John)];
return [John, Deco, Deco.setOwnersAsync(John)];
})
.spread(function (John, Deco) {
return [John, Person.findAsync({ pet: Deco, id: John.id })];
return [John, Person.findAsync({ pet: Deco })];
})
.spread(function(John, owner){
should.exist(owner[0]);
@@ -205,7 +207,7 @@ describe("hasOne Async", function () {
return [John, pets, pets[0].setOwnersAsync(John)];
})
.spread(function (John, pets) {
return [John, Person.findAsync({ pet: pets, id: John.id })];
return [John, Person.findAsync({ pet: pets })];
})
.spread(function (John, owners) {
should.exist(owners[0]);