-
Notifications
You must be signed in to change notification settings - Fork 181
tests: checks if column is discovered and mapped correctly #422
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
Conversation
}, | ||
}; | ||
Demo = db.createModel(demo_schema.name, demo_schema.properties, demo_schema.options); | ||
Demo.destroyAll(done); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment. why create a model and then destroy all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db.createModel
is to create model so that we can do CRUD operations. .destroyAll
is to delete all instances. They are basic steps and used in many test files.
test/postgresql.discover.test.js
Outdated
console.error(err); | ||
done(err); | ||
} else { | ||
models.forEach(function(m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why loop if there is only 1 model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Match with other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to not loop if it's only one model, even if it's inconsistent with the other tests, but it's not a big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edited, thanks!
test/postgresql.discover.test.js
Outdated
console.error(err); | ||
done(err); | ||
} else { | ||
models.forEach(function(m) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to not loop if it's only one model, even if it's inconsistent with the other tests, but it's not a big deal.
@slnode test please |
add a test case for Postgres for changes made in loopbackio/loopback-connector#171
demoId
Checklist
👉 Read and sign the CLA (Contributor License Agreement) 👈
npm test
passes on your machine