-
-
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
Update assert against nulls #5218
Conversation
^ is failing the build on Ember 1.13 and 2.4 (but passes on 2.8+). |
I can't reproduce locally via |
#5213 looked green on travis when I merged it... |
@@ -39,7 +39,7 @@ test("meta is proxied correctly on the PromiseArray", function(assert) { | |||
result = store.query('person', {}); | |||
}); | |||
|
|||
assert.equal(result.get('meta.foo'), undefined); | |||
assert.strictEqual(result.get('meta.foo'), undefined); |
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.
@pangratz I spent some time digging into this and couldn't figure out while its failing. I blame phantom weirdness. Lets leave this as assert.equal
so the tests pass since the fact that this returns undefined is Ember behavior and not Ember Data.
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.
Correction, I was just able to reproduce it. Turns out in Ember 1.13 Ember.get({foo: null}, 'foo.bar')
returns null
but in Ember 2.0 Ember.get({foo: null}, 'foo.bar')
returns undefined
.
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.
Uff, thanks for tracking that one down!
I've updated this assertion to be assert.notOk
.
This prevents us being trolled by QUnit, where assert.equal(undefined, null) is not a failing assertion.
This prevents us being trolled by QUnit, where assert.equal(null, undefined) is not a failing assertion.
* update assertion for meta proxied on AdapterPopulatedRecordArray * use `assert.strictEqual` when comparing against `null` This prevents us being trolled by QUnit, where assert.equal(undefined, null) is not a failing assertion. * use `assert.strictEqual` when comparing against `undefined` This prevents us being trolled by QUnit, where assert.equal(null, undefined) is not a failing assertion. * align test for DateTransform#deserialize(undefined) with implementation
Does this make sense? Basically this is to prevent us from future ing like reported in #5207. I am unsure if this is a good idea or if we should update the tests to use
assert.ok
/assert.notOk
instead 🤔 . Basically just did a search and replace...