Sha256: 6007a2a9853cbe1dad80d81e74133cb666e8af49ae7e576791806843c8abfa38

Contents?: true

Size: 884 Bytes

Versions: 3

Compression:

Stored size: 884 Bytes

Contents

export function verifyRegistration(assert, owner, fullName) {
  assert.ok(owner.resolveRegistration(fullName), `has registration: ${fullName}`);
}

export function verifyInjection(assert, owner, fullName, property, injectionName) {
  let registry = owner.__registry__;
  let injections;

  if (fullName.indexOf(':') === -1) {
    injections = registry.getTypeInjections(fullName);
  } else {
    injections = registry.getInjections(registry.normalize(fullName));
  }

  let normalizedName = registry.normalize(injectionName);
  let hasInjection = false;
  let injection;

  for (let i = 0, l = injections.length; i < l; i++) {
    injection = injections[i];
    if (injection.property === property && injection.specifier === normalizedName) {
      hasInjection = true;
      break;
    }
  }

  assert.ok(hasInjection, `has injection: ${fullName}.${property} = ${injectionName}`);
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/internal-test-helpers/lib/registry-check.js
discourse-ember-source-3.5.1.1 dist/es/internal-test-helpers/lib/registry-check.js
discourse-ember-source-3.5.1.0 dist/dist/es/internal-test-helpers/lib/registry-check.js