i have been working testing framework mocha , assertion library chai past few days. there possible way make interactive testing , passing inputs test in cli when test running ?
i don't know of direct support mocha input, can around using process.env
, gives access user environment, env
or set
, depending on os you're running on.
# unix env some_input=something secretkey=magic mocha test # windows set some_input=something set secretkey=magic mocha test
then in test:
var input = process.env.some_input; // "something" var key = process.env.secretkey; // "magic"
Comments
Post a Comment