lundi 20 juillet 2020

How do you find the filename and path of a running test in Jest

I am using Jest for testing. How do I access the filename or file path of the current test being run?

I need a conditional statement that runs different lines of code based on whether it is a unit test file or integration test file.

Here is an example of what I am trying to achieve:

beforeAll(() => {
  if (integration_test_file){
    // run this this code 

  } else if (unit_test_file){
    // run this code instead 
  }
})

Aucun commentaire:

Enregistrer un commentaire