Angular Karma Jasmine Error: Illegal state: Could not load the summary for directive

后端 未结 7 456
温柔的废话
温柔的废话 2021-02-03 16:47

I\'m developing a github repository (with angular 7 and angular-cli), and I have some tests with Karma and Jasmine working in the master branch.

Now I\'m trying to add l

7条回答
  •  攒了一身酷
    2021-02-03 17:03

    My coworker and I had this issue but the fix was way different than anything else on the internet.

    We are using Visual Studio Code and the folder names are case insensitive. Because of that, we asked everyone to use a lowercase naming convention but eventually an uppercase name got into source control. We renamed it, in a roundabout way, and everything was fine.

    A month later, my coworker started getting a specific unit test to break with this error message. Only his computer was breaking on that test. We literally commented out all the code that could possible be effecting the test and we still got the error. Finally, I globally searched for the class and we realized that the folder name had reverted back to the uppercase name. We renamed it back to a lowercase name, with no pending changes recognized might I add..., and the test worked.

    Let that be a lesson to follow style guides. :)

    For clarity, the fix was similar to changing the folder name FOO to foo.

提交回复
热议问题