0

I have this really weird case:

console.log(Interactions);
Interactions.getInteractions('/User', Interactions.channel);

When I log the object I can clearly see that the Interactions object has the getInteractions function, but when I try and call it I get undefined.

This is in a mocha test using chai.js with the should syntax. I'm not sure how relevant that is.

I've also defined Interactions like this:

Interactions = createModels();
setAjax($,
        {namespace: Interactions, 
         channel: Interactions.channel,
         appSettings: Interactions.settings}
);

The setAjax function is where the getInteractions method is defined.

I originally defined these things in the beforeEach() function but it wasn't even recognizing Interactions as being created. I'm not sure what's going on since this is my first time with Mocha. I've searched for hours and can't figure out where to even go from here. Any help would be great.

4

0 回答 0