title: How to call a method that is inside an object that is imported in different file
body: <p>Error: main.js:1 Uncaught TypeError: r.sum is not a function</p>
  
  <pre><code>// calculator.js
  let calculator = { 
      sum: function(a, b) {return a + b}
  };
  
  
  module.export = calculator;
  _______________________
  
  // index.js
  
  const calculator = require('./calculator')
  
  console.log(calculator.sum(3,4));
  
  or
  
  //index.test.js
  
  const calculator = require('./calculator')
  </code></pre>
  
  <p>I need to use the object method for testing purposes.</p>
  
  <p>Error: when I can to use the</p>
  
  <pre><code>main.js:1 Uncaught TypeError: r.sum is not a function
  </code></pre>