title: How to import other js files in casperjs
body: <p>Basically,I have extracted the re-usable functions into a file 'utility.js'.I want to import this file into every CasperJS test script.I'm following the documentation <a href="http://docs.casperjs.org/en/latest/writing_modules.html" rel="nofollow">here</a></p>
  
  <p>When i try to get it to work,I'm getting the following error.</p>
  
  <blockquote>
    <p>'undefined' is not a function </p>
  </blockquote>
  
  <p>Folder structure is like this</p>
  
  <pre><code>utility.js
  test1.js
  test2.js
  </code></pre>
  
  <p>Test file has following code as suggested by the above documentation</p>
  
  <pre><code>var require = patchRequire(require);
  var helper = require('utility');
  </code></pre>
  
  <p>and I access the function in utility.js as follows
      helper.fn_do_something()</p>
  
  <p>I tried to use other methods provided by casperJS,like</p>
  
  <pre><code>casper.options.clientscript = [relativepath];
  </code></pre>
  
  <p>But that didn't help.I'm getting the same error.</p>
  
  <p>I'm using PhantomJS 1.9.8.</p>