How to use the qunit.config function in qunit

To help you get started, we’ve selected a few qunit 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 / data / packages / unpublished-test-infra / addon-test-support / testem / custom-qunit-adapter.js View on Github external
QUnit.done(function() {
    let deprecations = QUnit.config.deprecations;
    console.log('Deprecations: ', JSON.stringify(deprecations)); // eslint-disable-line no-console

    socket.emit('test-metadata', 'deprecations', deprecations);
  });
}
github sympmarc / SPServices / test / Lists.js View on Github external
!(function(){

    var QUnit = require('qunit');
    var $ = require('jquery');
    var equal = require('equal');

    // A few QUnit configuration settings
    // For more, see: http://api.qunitjs.com/QUnit.config/
    QUnit.config.autostart  = false;
    QUnit.config.reorder    = false;

    /* Setup variables */
    var testList = {};
    testList.Name = new Date().toString();
    testList.Description = "This is the test description.";

    QUnit.test( "AddList", function(assert) {

        assert.expect(2);
        var done = assert.async();

        var p = $().SPServices({
            operation: "AddList",
            listName: testList.Name,
            description: testList.Description,
            templateID: 100
github ractivejs / ractive / tests / browser / getCSS.js View on Github external
test('getCSS with component definitions constructed from Ractive of different environments', t => {
      t.expect(5);

      // this test takes a while sometimes
      const timeout = QUnit.config.testTimeout;
      QUnit.config.testTimeout = 30000;
      setTimeout(() => {
        QUnit.config.testTimeout = timeout;
      }, 10);

      const done1 = t.async();
      const done2 = t.async();
      const done3 = t.async();
      const done4 = t.async();
      const done5 = t.async();

      // Simulate two separate Ractive environments using iframes
      Promise.all([createIsolatedEnv(), createIsolatedEnv()]).then(envs => {
        const ComponentA = createComponentDefinition(envs[0].Ractive);
        const ComponentB = createComponentDefinition(envs[1].Ractive);
github elwayman02 / ember-interactivity / addon-test-support / assert-interactivity.js View on Github external
function _getOwner() {
  let context = QUnit.config.current.testEnvironment;

  // getOwner(context) is set by ember-qunit for integration and unit tests
  // context.owner is set by our tests/helpers/module-for-acceptance.js for acceptance tests
  return getOwner(context) || context.owner;
}
github emberjs / ember-qunit / addon-test-support / ember-qunit / index.js View on Github external
this.pauseTest = function QUnit_pauseTest() {
        assert.timeout(-1); // prevent the test from timing out

        // This is a temporary work around for
        // https://github.com/emberjs/ember-qunit/issues/496 this clears the
        // timeout that would fail the test when it hits the global testTimeout
        // value.
        clearTimeout(QUnit.config.timeout);
        return originalPauseTest.call(this);
      };
    });
github emberjs / ember-qunit / addon-test-support / ember-qunit / test-isolation-validation.js View on Github external
export function installTestNotIsolatedHook(delay = 50) {
  if (!getDebugInfo()) {
    return;
  }

  let test = QUnit.config.current;
  let finish = test.finish;
  let pushFailure = test.pushFailure;

  test.pushFailure = function(message) {
    if (message.indexOf('Test took longer than') === 0) {
      detectIfTestNotIsolated(this, message);
    } else {
      return pushFailure.apply(this, arguments);
    }
  };

  // We're hooking into `test.finish`, which utilizes internal ordering of
  // when a test's hooks are invoked. We do this mainly becuase we need
  // greater precision as to when to detect and subsequently report if the
  // test is isolated.
  //
github ember-data / ember-data-filter / tests / test-helper.js View on Github external
assert.assertClean = function(promise) {
  return promise.then(this.wait(record => {
    this.equal(record.get('hasDirtyAttributes'), false, 'The record is now clean');
    return record;
  }));
};

assert.contains = function(array, item) {
  this.ok(array.indexOf(item) !== -1, `array contains ${item}`);
};

assert.without = function(array, item)  {
  this.ok(array.indexOf(item) === -1, `array doesn't contain ${item}`);
};

QUnit.config.testTimeout = 2000;
QUnit.config.urlConfig.push({
  id: 'enableoptionalfeatures',
  label: 'Enable Opt Features'
});

setApplication(Application.create(config.APP));
start({ setupTestIsolationValidation: true });
github fossasia / open-event-frontend / tests / test-helper.js View on Github external
import Application from '../app';
import QUnit from 'qunit';
import config from '../config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import loadEmberExam from 'ember-exam/test-support/load';

QUnit.config.testTimeout = 300000;

setApplication(Application.create(config.APP));

loadEmberExam();
start();
github dollarshaveclub / ember-uni-form / tests / test-helper.js View on Github external
import resolver from './helpers/resolver'
import {
  setResolver
} from 'ember-qunit'
import QUnit from 'qunit'

setResolver(resolver)

QUnit.config.testTimeout = 5000
github buschtoens / ember-on-modifier / tests / test-helper.js View on Github external
expected,
  message = `counters have incremented by ${JSON.stringify(expected)}`
) {
  if (__counts === null) {
    this.ok(true, 'using upstream implementation, not asserting on counts');
    return;
  }

  const current = __counts();

  this.deepEqual(
    current,
    {
      adds:
        expected.adds +
        QUnit.config.current.testEnvironment._startingCounts.adds,
      removes:
        expected.removes +
        QUnit.config.current.testEnvironment._startingCounts.removes
    },
    message
  );
};