-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
DS.Store type presence checks #4178
Conversation
37cb617
to
f6ea6da
Compare
Alrighty, I've updated to use only one test with many asserts |
@@ -281,6 +282,7 @@ Store = Service.extend({ | |||
@return {DS.Model} record | |||
*/ | |||
createRecord(modelName, inputProperties) { | |||
assert("You need to pass a type to the store's createRecord method", isPresent(modelName)); |
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.
Ember Data uses modelName
for the type argument in most of these functions. I also know that type
has also been used to refer to the same information. I think we should pick one term and be consistent. Right now I have a preference for modelName
but I could easily be convinced to use type
instead.
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've changed "type" to "model name" in the assertion messages |
'serializerFor' | ||
]; | ||
|
||
test("Calling Store methods with no type asserts", function(assert) { |
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.
Since #4223 the tests are also run in the production
environment, where the assertions are stripped. That's why this test is failing.
You need to use testInDebug
here instead of test
:
import testInDebug from 'dummy/tests/helpers/test-in-debug';
Sorry you fell over this. This is my fault, I need to update CONTRIBUTING.md
ASAP.
Can you squash into 1 commit and prefix with I think then this is good to go 🚀 |
cb67a75
to
d7d035b
Compare
Thanks @courajs. |
Fixes #4170.
Are you alright with generated tests like this?
I wasn't quite sure where to put these.
serializerFor
,createRecord
, and a few others have their own test files, but many of these didn't really seem to have a home. It also seems a small shame to split these tests up when they're almost exactly the same.