Detecting test environment

I have a project which uses sanjo:jasmine and velocity:html-reporter.

Is there a simple way for code to know that it is being run from jasmine (or nightwatch etc). I have some setup code in server/fixtures.js which is fouling up because the jasmine stubs/mocks don’t return anything. I’m just looking for a clean non-hacky way to avoid running the code in jasmine (or mocha) but still run it in all the other scenarios.