title: Making a jest test file for mysql database calls
body: <p>I'm very new to testing with Jest. I want to make a test to see if the following function returns user data from the database I have:</p>
  <pre><code>
  let dbConnect = require('../config/dbConnect');
  
  
  let findUserByEmail = (email) =&gt; {
      return new Promise(async (resolve, reject) =&gt; {
          try {
              dbConnect.query(&quot;SELECT * FROM user_login WHERE email = ?&quot;, email, function (error, results) {
                  if (error) reject(error);
                  let user = results[0];
                  if(user == undefined){
                      resolve()
                  }
                  resolve(user);
              })
          } catch (e) {
              reject(e);
          }
      })
  }
  </code></pre>
  <p>How would I go about making mock data to use in testing?</p>
  <p>EDIT: Here is dbConnect:</p>
  <pre><code>let mysql = require('mysql');
  
  let dotenv = require('dotenv');
  dotenv.config({path: '../.env'});
  
  let db = mysql.createConnection({
      host: process.env.DATABASE_HOST,
      database: process.env.DATABASE,
      user: process.env.DATABASE_USER,
      password: process.env.DATABASE_PASSWORD,
  });
  
  db.connect(function (error) {
      if (error) console.log(error);
      else console.log(&quot;MYSQL Connected...&quot;);
  });
  
  module.exports = db;
  </code></pre>