text: 'use strict';
  
  
  const events = require('../events');
  
  
  let order = {
      store: 'MyStore',
      orderID: 'e3669048-7313-427b-b6cc-74010ca1f8f0',
      customer: 'Jamal Braun',
      address: 'Schmittfort, LA'
  };
  
  
  
  describe('testing event handlers', () => {
      let consoleSpy;
  
      beforeAll(() => {
          consoleSpy = jest.spyOn(console, 'log').mockImplementation();
      });
        
      it('pickup event Work', async () => {
          events.emit('pickup', order);
          await consoleSpy();
          expect(consoleSpy).toHaveBeenCalled();
      });
  
      it('in-transit event Work ', async () => {
          events.emit('in-transit', order);
          await consoleSpy();
          expect(consoleSpy).toHaveBeenCalled();
      });
  
      it('delivered event Work  ', async () => {
          events.emit('delivered', order);
          await consoleSpy();
          expect(consoleSpy).toHaveBeenCalled();
      });
  
  
      afterAll(() => {
          consoleSpy.mockRestore();
      });
  
  });
   
  
  
  
  