So stellen Sie den Wert auf Readonly -Eigenschaft in TypenScript fest
Object.defineProperty(service, timeIntervals, { writable: true});
Graceful Gnat
Object.defineProperty(service, timeIntervals, { writable: true});
beforeEach(() => {
TestBed.configureTestingModule({
providers: [
MyService
]
});
service = TestBed.get(MyService);
const timeIntervals = 'timeIntervals';
Object.defineProperty(service, timeIntervals, { value: timeLists });
});