How to use the should.exist function in should

To help you get started, we’ve selected a few should 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 robrich / ternary-stream / test / index.js View on Github external
it('should error if no parameters passed', function(done) {
			// arrange
			var caughtErr;

			// act
			try {
				ternaryStream();
			} catch (err) {
				caughtErr = err;
			}

			// assert
			should.exist(caughtErr);
			caughtErr.message.indexOf('required').should.be.above(-1);
			done();
		});
github robrich / orchestrator / test / runOne_timeoutTask.js View on Github external
setTimeout(function () {

				// assert
				should.exist(task.err);
				task.err.should.equal(expectedErr);
				should.exist(task.runMethod);
				task.runMethod.should.equal(expectedRunMethod);

				a.should.equal(2); // task, run callback

				done();
			}, taskTimeout*2);
		});
github robrich / orchestrator / test / runOne_doneOnce.js View on Github external
doneOnce.run(args, function (/*err*/) {

				// assert
				should.exist(task.err);
				task.err.should.equal(expectedErr);
				
				done();
			});
		});
github LeanKit-Labs / vso-client / spec / vso-client.spec.js View on Github external
it( 'creates a query folder', function( done ) {
			testFolder = null;
			should.exist( testProject );
			should.exist( myQueries );
			client.createFolder( testProject.name, 'testFolder1', myQueries.id, function( err, folder ) {
				should.not.exist( err );
				should.exist( folder );
				// console.log(folder);
				folder.should.have.property( 'id' );
				folder.should.have.property( 'url' );
				testFolder = folder;
				done();
			} );
		} );
github thlorenz / dog / test / publisher-integration.js View on Github external
it('calls back with error indicating the mistake', function () {
        should.exist(error);  
        error.toString().should.include('post.json doesn\'t exist');
      })
    })
github node-opcua / node-opcua / test / end_to_end / alarms_and_conditions / u_test_e2e_conditions.js View on Github external
function extract_value_for_field(fieldName, result) {
            should.exist(result);
            var index = fields.indexOf(fieldName);
            should(index >= 0, " cannot find fieldName in list  : fiedName =" + fieldName + " list: " + fields.join(" "));
            return result[index];
        }
github eldargab / node-fake-fs / test / fake-fs.js View on Github external
cb.error = function(code) {
    called.should.equal(1)
    should.exist(err)
    err.should.have.property('code').equal(code)
  }
github slco-2016 / clientcomm / test / app / departmentsController.js View on Github external
}).then((resp) => {
      users = resp;

      should.exist(users);
      const supervisorsUrl = `/org/departments/${department.department_id}/supervisors`;
      owner.get(supervisorsUrl)
        .expect(200)
        .end((err, res) => {
          users.forEach((user) => {
            const lastFirst = `${user.last}, ${user.first}`;
            res.text.should.match(RegExp(lastFirst));
          });
          done(err);
        });
    }).catch(done);
  });
github TheFive / osmbc / model / pgMap.js View on Github external
function convertOneResultFunction(module, callback) {
  should.exist(callback);
  return function crs(err, pgResult) {
    if (err) return callback(err);
    if (pgResult.rows.length === 0) return callback(null, null);
    const row = pgResult.rows[0];
    var r = module.create();
    for (var k in row.data) {
      r[k] = row.data[k];
    }
    r.id = row.id;
    return callback(null, r);
  };
}
github TheFive / osmbc / model / pgMap.js View on Github external
function convertResultFunction(module, callback) {
  should.exist(callback);
  return function crs(err, pgResult) {
    const result = [];
    if (err) return callback(err);
    pgResult.rows.forEach(function(row) {
      var r = module.create();
      for (var k in row.data) {
        r[k] = row.data[k];
      }
      r.id = row.id;
      result.push(r);
    });
    return callback(null, result);
  };
}

should

test framework agnostic BDD-style assertions

MIT
Latest version published 6 years ago

Package Health Score

61 / 100
Full package analysis