How to use should - 10 common examples

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 oracle / node-oracledb / test / rowidDMLBindAsString.js View on Github external
function(err, result) {
        should.not.exist(err);
        var resultVal;
        if (typeof (result.outBinds.o) === 'undefined') resultVal = result.outBinds[0][0];
        else resultVal = result.outBinds.o[0];
        should.strictEqual(resultVal, expected);
        // should.strictEqual(typeof resultVal, "string");
        callback();
      }
    );
github oracle / node-oracledb / test / urowidDMLBindAsString1.js View on Github external
function(err, result) {
        should.not.exist(err);
        var resultVal;
        if (typeof (result.outBinds.o) === 'undefined') resultVal = result.outBinds[0][0];
        else resultVal = result.outBinds.o[0];
        should.strictEqual(resultVal, expected);
        // should.strictEqual(typeof resultVal, "string");
        callback();
      }
    );
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 firepick1 / firenodejs / js / firestep / mock-driver.js View on Github external
mockAsync(function() {
            should.deepEqual(testid, {
                s: 0,
                r: {
                    app: "mock-MTO_XYZ",
                    "ver": 1
                },
                t: 0.001
            });
        }); // mock async
    })
github firepick1 / firenodejs / js / firestep / mock-fpd.js View on Github external
mockAsync(function() {
            should.deepEqual(testid, {
                s: 0,
                r: {
                    app: "mock-MTO_FPD",
                    "ver": 1
                },
                t: 0.001
            });
        }); // mock async
    })
github node-red / node-red / test / nodes / core / function / 89-trigger_spec.js View on Github external
n2.on("input", function(msg) {
                    try {
			if (rval) {
			    msg.should.have.property("payload");
			    should.deepEqual(msg.payload, rval);
			}
			else {
			    msg.should.have.property("payload", val);
			}
                        delete process.env[val];
                        done();
                    }
                    catch(err) { done(err); }
                });
                n1.emit("input", {payload:null});
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');
      })
    })

should

test framework agnostic BDD-style assertions

MIT
Latest version published 6 years ago

Package Health Score

61 / 100
Full package analysis