title: jest test in node.js is failing showing Matcher error
body: <p>Jest test is failing. Matcher error: received value must have a length property whose value must be a number</p>
  
  <pre><code>Received has type:  object
  Received has value: {}
  </code></pre>
  
  <p>but object has a value and it is not {}</p>
  
  <p>index.js file</p>
  
  <pre><code>const fs = require('fs');
  
  select('company')
  
  async function select(selector)   {
  
  await fs.readFile('./content.html', 'utf8',    function (err, data) {
   if (err) throw err;
  
   regexForIds = new RegExp(/&lt;([^\s]+).*?id="company".*?&gt;(.+?)&lt;\/\1&gt;/gi);
  
   matches = data.match(regexForIds);
  
   const obj = {
     length:  matches.length
   };
  
   return obj
  
  });
  
  }
  
  module.exports = select;
  </code></pre>
  
  <p>index.js file</p>
  
  <pre><code>const select = require('./');
  test('select supports ids', () =&gt; {
    expect(select('#company')).toHaveLength(1);
  });
  </code></pre>