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 DefinitelyTyped / DefinitelyTyped / types / ember-test-helpers / ember-test-helpers-tests.ts View on Github external
QUnit.module(module.name, {
        beforeEach() {
            module.setup();
        },
        afterEach() {
            module.teardown();
        }
    });
}

async function testWait() {
    await wait();
}

if (hasEmberVersion(2, 10)) {
    // ...
}

// https://github.com/emberjs/ember-test-helpers/blob/f07e86914f2a3823c4cb6787307f9ba2bf447e68/tests/unit/setup-context-test.js
QUnit.test('it sets up this.owner', function(this: TestContext, assert: Assert) {
    const { owner } = this;
    assert.ok(owner, 'owner was setup');
    assert.equal(typeof owner.lookup, 'function', 'has expected lookup interface');

    if (hasEmberVersion(2, 12)) {
      assert.equal(typeof owner.factoryFor, 'function', 'has expected factory interface');
    }
});

QUnit.test('can pauseTest to be resumed "later"', async function(this: TestContext, assert: Assert) {
    const promise = this.pauseTest();
github DefinitelyTyped / DefinitelyTyped / types / ember-test-helpers / ember-test-helpers-tests.ts View on Github external
QUnit.test('it sets up this.owner', function(this: TestContext, assert: Assert) {
    const { owner } = this;
    assert.ok(owner, 'owner was setup');
    assert.equal(typeof owner.lookup, 'function', 'has expected lookup interface');

    if (hasEmberVersion(2, 12)) {
      assert.equal(typeof owner.factoryFor, 'function', 'has expected factory interface');
    }
});