title: TypeError: expect(...).toEqual is not a function
body: <p>I am following Dan Abramov's tutorial on Redux. (<a href="https://egghead.io/lessons/javascript-redux-avoiding-object-mutations-with-object-assign-and-spread" rel="noreferrer">https://egghead.io/lessons/javascript-redux-avoiding-object-mutations-with-object-assign-and-spread</a>)</p>
  
  <p>In lesson's 9 he introduces testing and using <code>expect</code> and <code>.toEqual()</code></p>
  
  <p>This is my code:</p>
  
  <pre><code>var expect = require('chai').expect;
  var freeze = require('deep-freeze-node');
  
  const testToggleTodo = () =&gt; {
      const todoBefore = {
          id: 0,
          text: 'Learn Redux',
          completed: false
      };
  
      const todoAfter = {
          id: 0,
          text: 'Learn Redux',
          completed: true
      };
  
      expect(
          toggleTodo(todoBefore)
          ).toEqual(todoAfter)
  }
  
  testToggleTodo();
  console.log('All tests passed.')
  </code></pre>
  
  <p>and I keep getting an error:</p>
  
  <pre><code>.../react_redux/src/a.js:24
          ).toEqual(todoAfter)
            ^
  
  TypeError: expect(...).toEqual is not a function
  </code></pre>
  
  <p>What am I doing wrong? I am copying his code verbatim, but it leads to errors. </p>