kellyselden / ember-macro-test-helpers

Convenience methods for testing Ember.js macros
MIT License
2 stars 2 forks source link

It's not possible to test null objects #117

Closed kishiamy closed 6 years ago

kishiamy commented 6 years ago

compute doesn't work for testing null objects, but it works for undefined

 test('it does not work', function(assert) {
   compute({
     assert,
      computed: readOnly('key1'),
      properties: {
        key1: null
      },
      strictEqual: null
    });
 });

 test('it works', function(assert) {
   compute({
     assert,
      computed: readOnly('key1'),
      properties: {
        key1: undefined
      },
      strictEqual: undefined
    });
 });

I guess the error comes from here: https://github.com/kellyselden/ember-macro-test-helpers/blob/73ddb59cba3bbf2dd067254221f7eead4a30f516/addon-test-support/compute.js#L50

kishiamy commented 6 years ago

Thank you so much!!