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

upsert happy path test #67

Closed
rjrodger opened this issue May 19, 2021 · 4 comments
Closed

upsert happy path test #67

rjrodger opened this issue May 19, 2021 · 4 comments
Assignees
Labels
release 4.0 review This label is used to tag issues that have been completed but the review is pending
Milestone

Comments

@rjrodger
Copy link
Collaborator

rjrodger commented May 19, 2021

let mf = () => seneca.make('foo')

let f01 = await mf().data$({x:1,y:22}).save$()
let f02 = await mf().data$({x:2,y:33}).save$()
let f03 = await mf().data$({x:2,y:44}).save$()
let f04 = await mf().data$({x:1,y:55,upsert$:['x']})
let foos = await.mf().list$()

// tests:
// f01.id != f02.id != f03.id
// f01.id == f04.id
// 3 == foos.length
// foos: [ {id:'<f01>', x:1, y:55 }, {id:'<f02>', x:2, y:33 }, {id:'<f03>', x:2, y:44 }, ]
// note: db does not have a unique index on x for this test

@lilsweetcaligula please review and examine for logical errors!

@rjrodger
Copy link
Collaborator Author

we do want a universal test, so given that postgres is strict about this, remove f03 from the above

@lilsweetcaligula lilsweetcaligula added the review This label is used to tag issues that have been completed but the review is pending label May 23, 2021
@rjrodger rjrodger added this to the release 4.x milestone May 25, 2021
@rjrodger
Copy link
Collaborator Author

Where is this test?

@lilsweetcaligula
Copy link
Collaborator

@rjrodger
Copy link
Collaborator Author

rjrodger commented Jun 3, 2021

this test needs to actually use the code above
you'll need to add seneca-promisify as a dev dep
write the test directly, without any before/after setup

@rjrodger rjrodger removed the review This label is used to tag issues that have been completed but the review is pending label Jun 3, 2021
@lilsweetcaligula lilsweetcaligula added the review This label is used to tag issues that have been completed but the review is pending label Jun 4, 2021
@rjrodger rjrodger closed this as completed Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release 4.0 review This label is used to tag issues that have been completed but the review is pending
Projects
None yet
Development

No branches or pull requests

2 participants