How to use the buster-node.testCase function in buster-node

To help you get started, we’ve selected a few buster-node 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 cliffano / nestor / test / api / util.js View on Github external
var buster  = require('buster-node');
var util    = require('../../lib/api/util');
var referee = require('referee');
var text    = require('bagoftext');
var assert  = referee.assert;

text.setLocale('en');

buster.testCase('api - util', {
  setUp: function () {
    this.mock({});
  },
  'passThroughResponse - should pass entire response': function (done) {
    function cb(err, result) {
      assert.isNull(err);
      assert.equals(result, 'someresponse');
      done();
    }
    util.passThroughResponse('someresponse', cb);
  },
  'passThroughSuccess - should pass result body': function (done) {
    function cb(err, result) {
      assert.isNull(err);
      assert.equals(result, 'somebody');
      done();
github cliffano / couchpenter / test / db.js View on Github external
shows: {} 
          }
        ] 
      }, 
     function (err, result) {
       assert.equals(err, null);
       assert.isTrue(!_.isEmpty(result));
       assert.isTrue(result[0][4].ok);
       done();
    });
  }

});


buster.testCase('db - _handle', {
  setUp: function () {
    this.mock({});
    this.db = new Db('http://localhost:5984', { nano: function (url) {} });
  },
  'should return result object when there is no error': function (done) {
    function _cb(err, result) {
      assert.isNull(err);
      assert.equals(result.id, 'db1/doc1');
      assert.equals(result.message, 'created');
      done();
    }
    this.db._handle(_cb, { dbName: 'db1', docId: 'doc1', message: 'created' })();
  },
  'should delegate to optional success callback when there is no error and success callback is specified': function (done) {
    function _successCb(err, result) {
      assert.isNull(err);

buster-node

A minimal Buster.JS configuration for testing node modules

Unrecognized
Latest version published 10 years ago

Package Health Score

36 / 100
Full package analysis

Popular buster-node functions