Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to check if wallaby is running my code? #2435

Closed
ioandev opened this issue Jun 3, 2020 · 1 comment
Closed

Is there a way to check if wallaby is running my code? #2435

ioandev opened this issue Jun 3, 2020 · 1 comment

Comments

@ioandev
Copy link

ioandev commented Jun 3, 2020

It might be bad practice, but I'd like to know "if wallaby" is running my code.

I know if jest does it, but I'm more interested if wallaby does it. More specifically I want the application I am testing not to show console error logs, unless "debugging" it with wallaby.

@smcenlly
Copy link
Member

smcenlly commented Jun 3, 2020

If you are running your tests in node, you can check if Wallaby is running your code by looking for process.env.WALLABY_ENV variable. The value will be a string with a value of true.

If you are running your tests in the browser, you can check whether a window variable is set, "window.$_$session".

@smcenlly smcenlly closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants