1

I have a buster.js test. I need to pass some data to the test via an environment variable. How can I do this?

Matt Fichman
  • 5,458
  • 4
  • 39
  • 59
  • you mean when launching it at the command line? Edit: I've just realized the question was made the '14. process.env.NODE_ENV; – R01010010 Feb 09 '16 at 18:16

1 Answers1

1

You mean when launching it at the command line?

I've just realized the question was made the '14, anyway: Run any node.js application along with the variable assignment, e.g:

VARIABLE_NAME='FOO' buster-test file.js

In the code:

process.env.VARIABLE_NAME;

R01010010
  • 5,670
  • 11
  • 47
  • 77