Я хочу смоделировать этот интерфейс и только одно свойство.
Код:
interface TheService
{
[index: number]: any;
...
}
Тесты
let theService: jasmine.SpyObj<TheService>;
beforeEach(() => {
theService = jasmine.createSpyObj<TheService>('theService', [0]);
});
it('does something', () => {
theService[0].and.returnValue({ dummy: 'test'});
...
console.log(theService[0].dummy); // here I want to print "test"
});
Можно ли издеваться над индексаторами в Жасмин?