How to use the ghost/tests/helpers/resolver.resolve function in ghost

To help you get started, we’ve selected a few ghost 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 manuelmitasch / ghost-admin-ember-demo / tests / helpers / isolated_container.js View on Github external
function isolatedContainer(fullNames) {
  var container = new Ember.Container();

  container.optionsForType('component', { singleton: false });
  container.optionsForType('view', { singleton: false });
  container.optionsForType('template', { instantiate: false });
  container.optionsForType('helper', { instantiate: false });

  for (var i = fullNames.length; i > 0; i--) {
    var fullName = fullNames[i - 1];
    container.register(fullName, resolver.resolve(fullName));
  }

  return container;
}
github manuelmitasch / ghost-admin-ember-demo / tests / helpers / module_for.js View on Github external
moduleFor('component:' + name, description, callbacks, function(container, context) {
    var templateName = 'template:components/' + name;

    var template = resolver.resolve(templateName);

    if (template) {
      container.register(templateName, template);
      container.injection('component:' + name, 'template', templateName);
    }

    context.__setup_properties__.$ = function(selector) {
      var view = Ember.run(function(){
        return context.subject().appendTo(Ember.$('#ember-testing')[0]);
      });

      return view.$();
    };
  });
}