title: How to replace file data
body: <p>In my folder I have <code>app.js</code>, <code>app.test.js</code> and <code>config.json</code></p>
  <p>My <code>config.json</code> is filled with the correct information but I want to test the negative scenario, when the file does not contain any data <code>data.length === 0</code></p>
  <p>How can I replace the config.json for the test without actually replacing the file correct data?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const fileData = fs.readFileSync(path.resolve(__dirname, './config.json'));
  const data = JSON.parse(fileData);
  
  if (!data || data.length === 0) {
    console.error('data is required!');
    return;
  }
  
     ... 
  
  
  
  // Test
  
  it('#lambdaHandler should validate data configuration file', async() =&gt; {
    const response = await app.myFunction();
  });</code></pre>
  </div>
  </div>
  </p>