jasmine.createSpy is not a function
<p>I wrote the below test. But when I run it I'm getting an error saying jasmine.createSpy is not a function.</p>

<pre><code>    import MyNode, {MqttOptions, IMessageReceivedCallBack, MyTopic, MyDataType,MyMessage} from '../../src/main/MyNode';
    import {expect} from 'chai';
    var mqtt: any = require('mqtt');
    var jasmine = require('jasmine');

    describe('MyNode Test Suite',() =&gt; {
      let myNode: MyNode;
      let mqttOptions: MqttOptions;
      let messageReceivedCallBack: IMessageReceivedCallBack;

      let willMessage = {
        topic: 'WillMessage',
        payload: 'This is the last will message',
        qos: 2,
        retain: 'true'
      };
      mqttOptions = {
        clientId: '100',
        protocolId: 'MQTT',
        protocolVersion: 4,
        keepAlive: 1000,
        clean: false,
        reconnectPeriod: '1000',
        will: willMessage
      };

      messageReceivedCallBack = {
        onMessageReceived(message: MyMessage) {
          console.log('Message was received :D ' + message.payload);
        }
      };

      it('Should call the connect method when constructor is called', () =&gt; {
        mqtt.connect = jasmine.createSpy('beforeeachthing');
        myNode = new MyNode('tcp://localhost:1883', mqttOptions, messageReceivedCallBack);
        jasmine.expect(mqtt.connect).to.have.been.called;
      });

    });
</code></pre>

<p>what is wrong here? I am new to this. Please advice.</p>