title: Karate: How to use a Javascript function from a DIFFERENT feature file
body: <p>I have created a feature file that will contain lots of javascript functions.</p>
  
  <p>From within a DIFFERENT feature file I want to use ONE of those functions (and pass in a value).</p>
  
  <p>How do I do this please?</p>
  
  <p>My feature file is called SystemSolentraCustomKarateMethods.feature</p>
  
  <p>Here is the current content (it currently contains just one function):</p>
  
  <pre><code>Feature: System Solentra Status Test
  
  Background:
  
  * def checkreturneddatetimeiscorrect =
  
  #The following code compares the passed in datetime with the current systemdatetime and
  #makes sure they are within 2 seconds of each other
  
  """
  function(datetime) {
  
  var datenow = new Date();
  karate.log("***The Date Now  = " + datenow.toISOString() + " ***");
  var timenow = datenow.getTime();
  karate.log("***The Time Now in Milliseconds  = " + timenow+ " ***");
  
  
  karate.log("***The Passedin Date  = " + datetime + " ***");
  var passedintime = new Date();
  passedintime = Date.parse(datetime);
  karate.log("***The Passed in Time = " + passedintime+ " ***");
  
  var difference = timenow - passedintime;
  karate.log("***The Time Difference = " + difference + " milliseconds ***");
  
  
  
  return (difference &lt; 2000)
  
  }
  """
  </code></pre>