title: TypeError: expect(...).toBe is not a function
body: <p>I am using this code to do a test, the <code>demo.js</code> code look like this:</p>
  <pre><code>var expect = require('chai').expect
  
  describe('Array', function() {
      describe('indexOf()', function() {
          it(&quot;dovrebbe tornare -1 quando l'elemento non è presente&quot;, function() {
              expect([1,2,3].indexOf(4)).to.equal(-1)
              expect(&quot;d&quot;).toBe( 'function' );
          })
      })
  })
  </code></pre>
  <p>when I run this command to execute the test:</p>
  <pre><code>istanbul cover _mocha ./test/demo.js
  </code></pre>
  <p>shows error like this:</p>
  <pre><code>[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/translation.js% istanbul cover _mocha ./test/demo.js
  
  
    Array
      indexOf()
        1) dovrebbe tornare -1 quando l'elemento non è presente
  
  
    0 passing (6ms)
    1 failing
  
    1) Array
         indexOf()
           dovrebbe tornare -1 quando l'elemento non è presente:
       TypeError: expect(...).toBe is not a function
        at Context.&lt;anonymous&gt; (test/demo.js:7:26)
  </code></pre>
  <p>what should I do fix this problem?</p>
  <ul>
  <li>node version: 10</li>
  <li>&quot;istanbul&quot;: &quot;^0.4.5&quot;,</li>
  </ul>
  <p>I also tried to install jest(<code>npm install --save-dev jest</code>), but still did not fix this problem. I think maybe the chai did not contain the toBe, which expect lib should I use.</p>