Exemplo n.º 1
0
test('expectNoDeprecation makes an assertion in production mode', function(){
  expect(1);

  var Ember = { deprecate: function(){} };
  assertion = new DeprecationAssert({Ember: Ember, runningProdBuild: true});

  assertion.reset();
  assertion.inject();

  window.expectNoDeprecation();

  assertion.assert();
});
Exemplo n.º 2
0
test('using expectNoDeprecation and expectDeprecation together throws an error', function() {
  var Ember = { deprecate: function(){ } };
  assertion = new DeprecationAssert({Ember: Ember});

  assertion.inject();

  try {
    window.expectNoDeprecation();
    window.expectDeprecation();
  } catch(error) {
    equal(error.message, 'expectDeprecation was called after expectNoDeprecation was called!');
  }

  assertion.reset();

  try {
    window.expectDeprecation();
    window.expectNoDeprecation();
  } catch(error) {
    equal(error.message, 'expectNoDeprecation was called after expectDeprecation was called!');
  }
});