-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Say we had the following TypeScript:
describe('initialization', () => {
it('retrieves the artist', fakeAsync(
inject([Router, SpotifyService, TestComponentBuilder],
(router: Router,
mockSpotifyService: MockSpotifyService,
tcb: TestComponentBuilder) => {
const fixture = tcb.createFakeAsync(RootCmp);
advance(fixture);
router.navigateByUrl('/artists/2');
advance(fixture);
expect(mockSpotifyService.getArtistSpy).toHaveBeenCalledWith('2');
})));
});It would be nice to be able to easily select the interior arrow function.
A few things that might make this easy to do:
- A way to select the
body(Block) of an element - A way to select the individual arguments of a call
- Seems easy and general enough to make a
bodyoperation. - Feels a bit tricky. We could do something like
get(selection, n), which would give thenthelement ofselection. But it would be nice if it was generous in it's interpretation of the "listness" of the selection. E.g. if it's an array, the nth element but if it's a function it's the nth parameter. I'm not sure about this.
While we're at it, it would be nice to support getting the value of an object this way as well. E.g. if n was a string, and selection was an object, then you get the value of key n.
Reactions are currently unavailable
