title: Protractor: Call a method within onprepare function
body: <p>I am trying to call a custom function in the onPrepare method in my local protractor config  which extends a global protrator config but am not able to get it to work. Inorder to make it a bit more simpler I wrote it like this inside my protractor.config</p>
  
  <pre><code>module.exports = {
      foo: function() {
          console.log('testing');
  
      },
      // A callback function called once protractor is ready and available, and
      // before the specs are executed
      // You can specify a file containing code to run by setting onPrepare to
      // the filename string.
      onPrepare: function() {
          //  At this point, global 'protractor' object will be set up, and jasmine
          //  will be available. For example, you can add a Jasmine reporter with:
          //      jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(
          //          'outputdir/', true, true));
  
  
  
  
          console.log(foo);
  
  
      },
  };
  </code></pre>
  
  <p>My local.protractor.config is</p>
  
  <pre><code>var globalConf = require('./protractor.conf.js');
  exports.config = globalConf;
  </code></pre>
  
  <p>But I get the error as foo being undefined.</p>
  
  <pre><code>[launcher] Error: ReferenceError: foo is not defined
  </code></pre>
  
  <p>Is there a way to add a custom method that onprepare can call which I can call from in my local.protractor.config </p>