Unit testing for BIng Maps using Jasmine in Angular RRS feed

  • Question

  • Hello Team, 

    I am trying to write test cases for Bing Map functionality in Angular 2^ version. But I am getting an issue like below. We defined this is component but don't know how to define in spec file. 

    MapComponent unit testing for loadMap FAILED
            ReferenceError: Microsoft is not defined

    Could you please help me out in this. 

    Thank you in Advance. 

    Friday, June 19, 2020 3:24 PM

All replies

  • Hi Venky,

    A quick search of the error you are receiving will provide the answer for you. Also there are other existing items within this forum such as https://social.msdn.microsoft.com/Forums/en-US/2fe652b7-1d00-4833-ae71-0a4d7d473cd5/uncaught-referenceerror-microsoft-is-not-defined?forum=bingmapsajax

    This is a scope issue and the "Microsoft is undefined" tells you the Microsoft items you are attempting to access are not available in your current scope.



    Wednesday, June 24, 2020 4:31 PM
  • Hello IoTGirl 

    Thank you for your response.

    Yes, I understood this is the scope issue. But Here my problem is ? How to give reference of this package. 

    In my application, I gave CDN in html using script tag. I am trying write unit tests for it. So I am not getting how to give reference package unit testing. 

    Thank you. 

    Wednesday, June 24, 2020 5:51 PM
  • Hi Venky,

    Please read the post I provided and follow the guidance and links there.  Look at the final post from that poster to see their declaration.



    Thursday, June 25, 2020 9:06 PM