How to load mock data from JSON file in Angular 2 karma jasmine test?
问题 I writing karma jasmine test case for angular 2 , And we came across requirement to mock data in separate JSON file as data is huge (want to make sure code cleanness). For this I searched a lot but didn't find proper solution. We already mocking HTTP service using MockBackend , So we can't use HTTP service of angular to load JSON as it eventually request will go to MockBackend. So is there any another way without using any third party lib like jasmine-jquery or Karma-jasmine-preprocessor ?