How to use the vows.describe function in vows

To help you get started, we’ve selected a few vows 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 moshen / node-googlemaps / test / geocode.js View on Github external
var vows = require('vows'),
	assert = require('assert'),
	gm = require('../lib/googlemaps');

vows.describe('geocode').addBatch({
	'Simple geocode (Chicago)': {
		topic: function(){
			gm.geocode('Chicago , Il , USA', this.callback, 'false');
		},
		'returns as a valid request': function(err, result){
			assert.equal(result.status , 'OK');
		},
		'returns the expected lat/lng for Chicago': function(err, result){
			assert.equal(result.results[0].geometry.location.lat , 41.8781136);
			assert.equal(result.results[0].geometry.location.lng , -87.6297982);
		}
	}
}).export(module);


/*  Geocode query results
github bpaquet / node-logstash / test / test_100_file_loader.js View on Github external
/* jshint unused:false */
var vows = require('vows'),
  assert = require('assert'),
  file_loader = require('lib/file_loader');

vows.describe('File loader').addBatch({
  'simple': {
    topic: function() {
      file_loader.loadFile('test/file_loader_test/simple', this.callback);
    },

    check: function(err, result) {
      assert.ifError(err);
      assert.deepEqual(result, ['input://stdin://']);
    }
  },

  'multiple': {
    topic: function() {
      file_loader.loadFile('test/file_loader_test/multiple', this.callback);
    },
github arnabc / node-safe-browse / test / api-spec.js View on Github external
'http://beatageyer.com/projects/pages/google%2520site%2520check%2520malware.html',
    'http://benanshell.cz.cc',
    'http://gumblar.cn',
    'http://yahoo.com',
    'http://www.msn.com'
];

// Good URLs
var goodUrls = [
    'http://www.aol.com',
    'http://www.facebook.com',
    'http://mint.com',
    'http://twitter.com'
];

vows.describe('Safe Browse API')
    .addBatch( {
        'Should always insist on an API key to be specified': {
            topic: [null],
            'should generate error if no API key is specified': function ( topic ) {
                var error = 'An API key is required to connect to the Google SafeBrowsing API';
                assert.throws( function () {
                    createSafeBrowseObj.apply( exports, topic );
                },
                new RegExp( error ) );
            }
        },

        'Should throw error if invalid URI/URIs provided': {

            topic: createSafeBrowseObj( apiKey ),
github vowsjs / cli-easy / lib / cli-easy / suite.js View on Github external
var Suite = core.Suite = function Suite (text) {
  //
  // Store cliPath for later usage
  //
  this.suite = vows.describe(text);

  //
  // A batches array
  //
  this.batches = [];

  return new CLIeasy.Batch(this);
};
github nodeca / js-yaml / test / helper.js View on Github external
Helper.suite = function suite(name, dirname, regexp) {
  var obj = Vows.describe(name);

  Fs.readdirSync(dirname).forEach(function (filename) {
    var file = Path.join(dirname, filename);

    if (Fs.statSync(file).isFile() && regexp.test(filename)) {
      obj.addBatch(require(file));
    }
  });

  return obj;
};
github sigkell / irc-message / test / tostring.js View on Github external
var ircmessage = require("../"),
    vows = require("vows"),
    should = require("chai").should();

vows.describe("Converting parsed messages to strings").addBatch({
    "#toString() on parsed message": {
        "with command only": {
            topic: (ircmessage.parseMessage("FOO")).toString(),

            "should return 'FOO'": function(topic) {
                return topic.should.equal("FOO");
            }
        },
        "with prefix, command": {
            topic: (ircmessage.parseMessage(":test FOO")).toString(),

            "should return ':test FOO'": function(topic) {
                return topic.should.equal(":test FOO");
            }
        },
        "with prefix, command, middle, trailing parameter": {
github ciaranj / node-oauth / tests / sha1tests.js View on Github external
var vows = require('vows'),
    assert = require('assert');

vows.describe('SHA1 Hashing').addBatch({
    'When using the SHA1 Hashing function': {
        topic: require('../lib/sha1'),
        'we get the specified digest as described in http://oauth.net/core/1.0/#sig_base_example (A.5.2)': function (sha1) {
            assert.equal (sha1.HMACSHA1( "kd94hf93k423kf44&pfkkdhi9sl3r4s00",
                           "GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal"), 
                           "tR3+Ty81lMeYAr/Fid0kMTYa/WM=");
        }
    }
}).export(module);
github tonaljs / tonal / test / interval / class-number.js View on Github external
var vows = require('vows')
var assert = require('assert')
var quality = require('../../lib/interval/quality')

vows.describe('Interval').addBatch({
  'pitch quality': function () {
    assert.equal(quality('P5'), 'P')
    assert.equal(quality('d-6'), 'd')
  }
}).export(module)
github serverless-examples / serverless-cd-example / test / books / index.js View on Github external
var vows = require('vows');

var suite = vows.describe('Books Get')

process.env.IS_UNIT_TEST = true;
process.env.SERVERLESS_STAGE = 'unit-test';

require('./get')(suite);
require('./post')(suite);
require('./put')(suite);
require('./delete')(suite);

module.exports.books = suite;
github scriby / asyncblock / tests / functionality.js View on Github external
var vows = require('vows');
var assert = require('assert');
var util = require('util');
var asyncblock = require('../asyncblock.js');

var suite = vows.describe('functionality');

var noParams = function(callback){
    process.nextTick(function(){
        callback();
    });
};

var immed = function(callback){
    callback(null, 'immed');
};

var immedArray = function(callback) {
    callback(null, [1, 2, 3]);
};

var immedMultiple = function(callback) {

vows

Asynchronous BDD & continuous integration for node.js

Apache-2.0
Latest version published 5 years ago

Package Health Score

48 / 100
Full package analysis

Popular vows functions