Intellisence support for Mocha and Typescript/Javacript

I have following code: 

import {  Shop, VoucherTestData } from '../types/types';
import voucherActions from '../actions/common/voucher-actions';
import { CheckoutActionsCats } from '../actions/cats/checkout-actions';
import { CheckoutActionsDogs } from '../actions/dogs/checkout-actions';
import { CheckoutActions } from '../actions/common/checkout-actions';

interface VoucherTestData {
shop: string;
checkoutActions: CheckoutActions;

export function testVoucher(data: VoucherTestData) {
  context(`${}`, function () {

    beforeEach(function () {
      this.checkoutActions = === Shop.CATS ? <CheckoutActionsCats>data.checkoutActions : <CheckoutActionsDogs>data.checkoutActions;

    describe('Redeem voucher as a guest user', function () {
      it('I can redeem valid voucher', function () {
        voucherActions.redeemVoucher(voucher, true, loc);

I an using Mocha, Typescript and Cypress.

When I do CTRL + mouse click on  this.checkoutActions.landOnCheckoutPageAsGuest(checkoutGuestModel);

I don't get any method definition intellisence - it says "Cannot find declaration to go to". I would expect it can offer me two implementations  => one from CheckoutActionsCats and one from CheckoutActionsDogs.

CheckoutActionsCats extends CheckoutActions and CheckoutActionsDogs also extends CheckoutActions.

Why is its acting like this? Is there any way to fix it?


1 comment

Please could you share a full, self-containing code snippet (or a set of files) the issue can be repeated with?


Please sign in to leave a comment.