How to use qunit-cli - 10 common examples

To help you get started, we’ve selected a few qunit-cli 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 devongovett / reader / tests / utils.js View on Github external
var QUnit = require('qunit-cli'),
    assert = QUnit.assert,
    utils = require('../src/utils');
    
QUnit.module('Utils');

var user = { id: 'id' };
QUnit.test('parseTags', function() {
    assert.equal(utils.parseTags(null, user), null);
    assert.equal(utils.parseTags('invalid', user), null);
    assert.deepEqual(utils.parseTags('user/id/label/test', user), [
        { type: 'label', name: 'test', user: user }
    ]);
    
    // google reader also allows the shared.userID to be replaced with a -
    assert.deepEqual(utils.parseTags('user/-/label/test', user), [
        { type: 'label', name: 'test', user: user }
    ]);
    
    assert.deepEqual(utils.parseTags(['user/id/label/test', 'user/id/state/com.google/read'], user), [
        { type: 'label', name: 'test', user: user },
github devongovett / reader / tests / acceptance / user.js View on Github external
var QUnit = require('qunit-cli'),
    assert = QUnit.assert,
    fs = require('fs'),
    xml = require('libxmljs'),
    shared = require('./shared'),
    request = shared.request;

QUnit.module('Auth');

QUnit.asyncTest('ClientLogin invalid username', function() {
    request.post(shared.server + '/accounts/ClientLogin', function(err, res, body) {
        assert.equal(res.statusCode, 403);
        // assert.equal(body, 'Error=BadAuthentication\n'); // sometimes returns CaptchaRequired instead...

        QUnit.start();
    }).form({ Email: 'invalid@example.com', Passwd: 'password' });
});

QUnit.asyncTest('ClientLogin invalid password', function() {
    request.post(shared.server + '/accounts/ClientLogin', function(err, res, body) {
        assert.equal(res.statusCode, 403);
        // assert.equal(body, 'Error=BadAuthentication\n');

        QUnit.start();
github Kurento / kurento-client-js / test / core / MediaElement.js View on Github external
*
 */

if (typeof QUnit == 'undefined') {
  QUnit = require('qunit-cli');
  QUnit.load();

  kurentoClient = require('..');

  require('./_common');
};

if (QUnit.config.prefix == undefined)
  QUnit.config.prefix = '';

QUnit.module(QUnit.config.prefix + 'MediaElement', lifecycle);

QUnit.test('setVideoFormat', function (assert) {
  assert.expect(2);

  var done = assert.async();

  this.pipeline.create(QUnit.config.prefix + 'PassThrough', function (error, passThrough) {
    if (error) return onerror(error)

    var caps = {
      codec: 'RAW',
      framerate: {
        numerator: 30,
        denominator: 1
      }
    }
github devongovett / reader / tests / api / stream.js View on Github external
var QUnit = require('qunit-cli'),
    assert = QUnit.assert,
    shared = require('../shared'),
    request = shared.request;
    
QUnit.module('Stream');

QUnit.asyncTest('details', function() {
    request(shared.api + '/stream/details?s=feed/http://example.com/feed.xml', function(err, res, body) {
        assert.equal(res.statusCode, 200);
        assert.ok(/json/.test(res.headers['content-type']));
        
        body = JSON.parse(body);
        assert.equal(body.subscribers, '1');
        assert.equal(body.velocity, '0.0');
        assert.equal(typeof body.successfulCrawlTimeUsec, 'number');
        assert.equal(typeof body.failedCrawlTimeUsec, 'number');
        assert.equal(body.lastFailureWasParseFailure, false);
        assert.deepEqual(body.trendsCharts, {});
        assert.equal(body.feedUrl, 'http://example.com/feed.xml');
        
        QUnit.start();
github Kurento / kurento-client-js / test_reconnect / index.js View on Github external
done();
  };
}

function sleep(seconds) {
  var e = new Date().getTime() + (seconds * 1000);

  while (new Date().getTime() <= e) {;
  }
}

Timeout.factor = parseFloat(QUnit.config.timeout_factor) || 1;

QUnit.config.testTimeout = 310000 * Timeout.factor;

QUnit.module('reconnect', {
  beforeEach: function () {
    var self = this;

    var options = {
      request_timeout: 5000 * Timeout.factor,
      failAfter: 15
    };

    if (argv.scope == "local") {
      var ws_uri = 'ws://127.0.0.1:' + argv.ws_port + '/kurento'

      this.server = spawn('kurento-media-server', ARGV)
        .on('error', onerror)

      this.server.stdout.on('data', function (data) {
        console.log('stdout: ' + data);
github Kurento / kurento-client-js / test / HttpGetEndpoint.js View on Github external
* @author Jesús Leganés Combarro "piranna" (piranna@gmail.com)
 * @version 1.0.0
 *
 */

if (typeof QUnit == 'undefined') {
  QUnit = require('qunit-cli');
  QUnit.load();

  kurentoClient = require('..');

  require('./_common');
  require('./_proxy');
};

QUnit.module('HttpGetEndpoint', lifecycle);

QUnit.asyncTest('Method GetUrl', function () {
  var self = this;

  QUnit.expect(2);

  self.pipeline.create('HttpGetEndpoint', function (error, httpGet) {
    if (error) return onerror(error);

    QUnit.notEqual(httpGet, undefined, 'httpGet');

    httpGet.getUrl(function (error, url) {
      if (error) return onerror(error);

      QUnit.notEqual(url, undefined, 'URL: ' + url);
github Kurento / kurento-client-js / test / PlateDetectorFilter.js View on Github external
*/

if(typeof QUnit == 'undefined')
{
  QUnit = require('qunit-cli');

  wock = require('wock');

  KwsMedia = require('..');

  require('./_common');
  require('./_proxy');
};


QUnit.module('PlateDetectorFilter', lifecycle);

QUnit.asyncTest('Detect plate in a video', function()
{
  var self = this;

  QUnit.expect(1);

  var timeout = new Timeout('"PlateDetectorFilter:Detect plate in a video"',
                            10 * 1000, onerror);


  self.pipeline.create('PlayerEndpoint', {uri: URL_PLATES}, function(error, player)
  {
    if(error) return onerror(error);

    self.pipeline.create('PlateDetectorFilter', function(error, plateDetector)
github Kurento / kurento-client-js / test / RtpEndpoint2.js View on Github external
*/

if(typeof QUnit == 'undefined')
{
  QUnit = require('qunit-cli');

  wock = require('wock');

  kurentoClient = require('..');

  require('./_common');
  require('./_proxy');
};


QUnit.module('RtpEndpoint2', lifecycle);

QUnit.asyncTest('CampusParty simulated pipeline', function()
{
  var self = this;

  QUnit.expect(2);

  self.pipeline.create('RtpEndpoint', function(error, rtpEndpoint)
  {
    if(error) return onerror(error);

    var offer = "v=0\r\n"
              + "o=- 12345 12345 IN IP4 192.168.1.18\r\n"
              + "s=-\r\n"
              + "c=IN IP4 192.168.1.18\r\n"
              + "t=0 0\r\n"
github Kurento / kurento-client-js / test / PointerDetectorFilter.js View on Github external
*/

if(typeof QUnit == 'undefined')
{
  QUnit = require('qunit-cli');

  wock = require('wock');

  KwsMedia = require('..');

  require('./_common');
  require('./_proxy');
};


QUnit.module('PointerDetectorFilter', lifecycle);

QUnit.asyncTest('Detect pointer', function()
{
  var self = this;

  QUnit.expect(1);

  var timeout = new Timeout('"PointerDetectorFilter:Detect pointer"',
                            20 * 1000, onerror);


  self.pipeline.create('PlayerEndpoint', {uri: URL_POINTER_DETECTOR}, function(error, player)
  {
    if(error) return onerror(error);

    self.pipeline.create('PointerDetectorFilter', function(error, pointerDetector)
github Kurento / kurento-client-js / test / elements / Composite.js View on Github external
*/

if (typeof QUnit == 'undefined') {
  QUnit = require('qunit-cli');
  QUnit.load();

  kurentoClient = require('..');

  require('./_common');
  require('./_proxy');
};

if (QUnit.config.prefix == undefined)
  QUnit.config.prefix = '';

QUnit.module(QUnit.config.prefix + 'Composite', lifecycle);

QUnit.asyncTest('create with Callback', function () {
  QUnit.expect(4);

  this.pipeline.create('Composite', function (error, composite) {
    QUnit.equal(error, undefined, 'create composite');

    if (error) return onerror(error);

    QUnit.notEqual(composite, undefined, 'composite');

    return composite.createHubPort(function (error, hubPort) {
      QUnit.equal(error, undefined, 'createHubPort');

      if (error) return onerror(error);

qunit-cli

A command line interface for the QUnit testing framework

Unknown
Latest version published 10 years ago

Package Health Score

30 / 100
Full package analysis

Popular qunit-cli functions

Similar packages