How to use the @ember/test-helpers/has-ember-version function in @ember/test-helpers

To help you get started, we’ve selected a few @ember/test-helpers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / ember-qunit / addon-test-support / ember-qunit / adapter.js View on Github external
// addressing the pairing of asyncStart/asyncEnd behavior in a more consistent way.
    if (test === currentTest) {
      done();
    }
  },

  // clobber default implementation of `exception` will be added back for Ember
  // < 2.17 just below...
  exception: null,
});

// Ember 2.17 and higher do not require the test adapter to have an `exception`
// method When `exception` is not present, the unhandled rejection is
// automatically re-thrown and will therefore hit QUnit's own global error
// handler (therefore appropriately causing test failure)
if (!hasEmberVersion(2, 17)) {
  Adapter = Adapter.extend({
    exception(error) {
      unhandledRejectionAssertion(QUnit.config.current, error);
    },
  });
}

export default Adapter;
github emberjs / ember-test-helpers / addon-test-support / ember-test-helpers / legacy-0-6-x / test-module.js View on Github external
var resolver = this.resolver;

    var items = buildRegistry(
      !isolated
        ? resolver
        : Object.create(resolver, {
            resolve: {
              value() {},
            },
          })
    );

    this.container = items.container;
    this.registry = items.registry;

    if (hasEmberVersion(1, 13)) {
      var thingToRegisterWith = this.registry || this.container;
      var router = resolver.resolve('router:main');
      router = router || EmberRouter.extend();
      thingToRegisterWith.register('router:main', router);
    }
  }
github emberjs / data / tests / helpers / model-factory-injection.js View on Github external
export function setup(value) {
  if (arguments.length > 0) {
    value = arguments[0];
  } else {
    value = true;
  }

  if (!hasEmberVersion(2, 14)) {
    Ember.MODEL_FACTORY_INJECTIONS = value;
  }
}