I want to clean a database before running my test cases and I'm just having issues with it running. It just times out and I don't understand - hopefully you can help me :)
In the test case I have the following code block:
beforeEach(() => {
      cy.task("cleanUpDB", {
        sql:"UPDATE SQL GOES HERE"
      })
This then goes to my cypress.config file and the following is executed:
on("task", {
        cleanUpDB({ theQuery }) {
          return new Promise(async(resolve, reject) => {
            try{
              await sql.connect(DBConfig)
            const result = await sql.query(theQuery);
            console.log(result)
            return resolve(result);
          }
          catch (err) {
              // ... error checks
             }
          }
          )
        }
      })
