Ejemplo n.º 1
0
var f = function() {
  registerHelper('equalProp', function(app,obj,prop,exp) {
    equal(obj.get(prop),exp,"Expected " + prop + " to equal " + exp);
  });

  registerHelper('equalLength', function(app,arr,expLength) {
    var l = arr.length;
    if (!l && arr.get) {
      l = arr.get('length');
    }

    equal(l,expLength,"Expected list of length "+expLength+" Got "+l);
  });
};
import { registerHelper } from '@ember/test';
import QUnit from 'qunit';
import assertionBuilder from '../utils/defined-attribute-assertion-builder';

QUnit.assert.githubRepositoryContentsOk = assertionBuilder([
  'id',
  'content',
  'downloadUrl',
  'encoding',
  'gitUrl',
  'htmlUrl',
  'name',
  'path',
  'sha',
  'size',
  'type',
  'url'
]);

export default registerHelper(
  'assertGithubRepositoryContentsOk',
  function (app, assert, contents) {
    assert.githubRepositoryContentsOk(contents);
  }
);
import { registerHelper } from '@ember/test';
import QUnit from 'qunit';
import assertionBuilder from '../utils/defined-attribute-assertion-builder';

QUnit.assert.githubMemberOk = assertionBuilder([
  'id',
  'login',
  'avatarUrl',
  'gravatarId',
  'url',
  'type',
  'siteAdmin'
]);

export default registerHelper(
  'assertGithubMemberOk',
  function (app, assert, member) {
    assert.githubMemberOk(member);
  }
);
Ejemplo n.º 4
0
import { run } from '@ember/runloop';
import { registerHelper } from '@ember/test';
export default registerHelper('triggerPort', async function t(app, ...args) {
  run(() => app.__container__.lookup('port:main').trigger(...args));
  await wait();
});