I have a file called mock_event
that serves as a template for creating an event object used in unit testing. Below, you can find the code snippet where this object is initialized:
mock_event.ts
import {Event} from "../../../models/src/event";
import {EventUserView} from "../../../models/src/event_user_view";
let validEvent: Event;
validEvent = new Event({
'eventId': '123',
'organizer': new EventUserView({
'displayName': 'Jim'
})
});
export {validEvent};
However, I am encountering an issue where upon importing the validEvent
object, it appears to be undefined
. Being relatively new to TypeScript, I suspect that I might have overlooked something simple. Even setting a breakpoint at the export statement reveals that the object remains undefined, despite being instantiated on the line just before. No exceptions are thrown either. Can anyone shed light on what might be causing this unexpected behavior?