CuriousFellow CuriousFellow - 1 year ago 62
Node.js Question

Function parameter failing to execute in Node.JS Jasmine test

I'm trying to execute a function that is passed in as a parameter in my Jasmine test.

I'm calling my function within this for-loop, but getting

"TypeError: barbican_function is not a function"

Stress Test Code to Test High Request Hits To API Endpoint
//Stress Test for Key Retrieval
var stressTestRunner = function(barbican_function) {
describe("Stress test", function() {
it("Send X requests to single key", function(done) {
for (var x = 0; x < requestsToHit; x++) {


function stressTest_retrieve_secret() {

//My code here

Answer Source

Because of this line:


You are calling the function and passing in the function's return value.

What you most likely mean is:


which passes in a function reference.

Debugging hint: Next time you get an error like this, open up your browser's debugging tools and put a breakpoint on your code. That would let you examine the various variable and parameters to see what is going on.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download