How to use mocha-test-container-support - 10 common examples

To help you get started, we’ve selected a few mocha-test-container-support 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 bpmn-io / table-js / test / spec / features / combo-box / ComboBoxSpec.js View on Github external
beforeEach(function() {
    // Make sure the test container is an optional dependency and we fall back
    // to an empty <div> if it does not exist.
    //
    // This is needed if other libraries rely on this helper for testing
    // while not adding the mocha-test-container-support as a dependency.
    try {
      testContainer = TestContainer.get(this);
    } catch (e) {
      testContainer = document.createElement('div');
      document.body.appendChild(testContainer);
    }

    testContainer.classList.add('test-container');
  });
</div>
github bpmn-io / bpmn-js-properties-panel / test / helper / index.js View on Github external
return function(done) {
    var testContainer;

    // Make sure the test container is an optional dependency and we fall back
    // to an empty <div> if it does not exist.
    //
    // This is needed if other libraries rely on this helper for testing
    // while not adding the mocha-test-container-support as a dependency.
    try {
      // 'this' is the current test context
      testContainer = TestContainer.get(this);
    } catch (e) {
      testContainer = document.createElement('div');
      document.body.appendChild(testContainer);
    }

    testContainer.classList.add('test-container');

    var _options = options,
        _locals = locals;

    if (_locals === undefined &amp;&amp; isFunction(_options)) {
      _locals = _options;
      _options = null;
    }

    if (isFunction(_options)) {</div>
github bpmn-io / cmmn-js / test / helper / index.js View on Github external
return function(done) {
    var testContainer;

    // Make sure the test container is an optional dependency and we fall back
    // to an empty <div> if it does not exist.
    //
    // This is needed if other libraries rely on this helper for testing
    // while not adding the mocha-test-container-support as a dependency.
    try {
      // 'this' is the current test context
      testContainer = TestContainer.get(this);
    } catch (e) {
      testContainer = document.createElement('div');
      document.body.appendChild(testContainer);
    }

    testContainer.classList.add('test-container');

    var _options = options,
        _locals = locals;

    if (_locals === undefined &amp;&amp; isFunction(_options)) {
      _locals = _options;
      _options = null;
    }

    if (isFunction(_options)) {</div>
github bpmn-io / table-js / test / helper / index.js View on Github external
return function() {

    var testContainer;


    // Make sure the test container is an optional dependency and we fall back
    // to an empty <div> if it does not exist.
    //
    // This is needed if other libraries rely on this helper for testing
    // while not adding the mocha-test-container-support as a dependency.
    try {
      testContainer = TestContainer.get(this);
    } catch (e) {
      testContainer = document.createElement('div');
      document.body.appendChild(testContainer);
    }

    testContainer.classList.add('test-container');


    var _options = options,
        _locals = locals;

    if (!_locals &amp;&amp; isFunction(_options)) {
      _locals = _options;
      _options = null;
    }
</div>
github bpmn-io / cmmn-js / test / spec / import / ImporterSpec.js View on Github external
beforeEach(function() {
    container = TestContainer.get(this);
    modeler = new Modeler({ container: container });
  });
github bpmn-io / cmmn-js / test / spec / features / modeling / LabelBoundsSpec.js View on Github external
beforeEach(function() {
    container = TestContainer.get(this);
  });
github bpmn-io / cmmn-js / test / spec / ModelerSpec.js View on Github external
beforeEach(function() {
    container = TestContainer.get(this);
  });
github bpmn-io / diagram-js / test / spec / layout / IntersectionSpec.js View on Github external
beforeEach(function() {
    var testContainer = TestContainer.get(this);

    var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    svg.setAttribute('width', '100%');
    svg.setAttribute('height', '100%');

    testContainer.appendChild(svg);

    paper = new Snap(svg);
  });

mocha-test-container-support

An extension for Mocha that provides test container support.

MIT
Latest version published 9 years ago

Package Health Score

45 / 100
Full package analysis

Popular mocha-test-container-support functions

Similar packages