1

I am trying to test functions in my script that I have written in Node JS. I am using tape for unit testing. But I am facing one problem of how to make each test case independent. Eg. there are some global variables in the script. The values of these variables are getting set inside these methods. Now, the problem is these variables are sharing the values among different unit test cases. Is there a way to clear all global variables before any test case ran?

Chacha
  • 411
  • 1
  • 5
  • 12

0 Answers0