0

I see a lot of examples (including ember-cli generated tests) that use assert.function() but I can use the function as is, so am I doing something wrong, or do examples just show not-really-necessary qualifiers?

For example, either of these work in a new generated unit test:

assert.expect(1);

expect(1);

Why ever do the first one if the second one works?

GJK
  • 37,023
  • 8
  • 55
  • 74
redOctober13
  • 3,662
  • 6
  • 34
  • 61

1 Answers1

2

This is actually a QUnit change, not an Ember one. QUnit is changing their API as they move towards 2.0. You can use the global versions now, but they'll be removed in 2.0 so it's probably a good idea to use the assert.* versions now so you don't have to change the code later.

GJK
  • 37,023
  • 8
  • 55
  • 74
  • agreed -if you look at the test syntax with ember-cli you will see assert (the variable). If you didn't see it you would be relying on some global like @GJK mentioned – Toran Billups Aug 27 '15 at 02:46