module-augmentation

How to augment @types/mocha? [duplicate]

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-17 15:58:05
问题 This question already has an answer here : How to extend Mocha's Context interface? (1 answer) Closed 6 days ago . I tried to apply Aluan's answer in countless different ways, but none worked, that is, none gave me the sweet auto-complete for the types that I augmented: augmentations.d.ts import { Foo } from './foo'; declare module "mocha" { namespace Mocha { export interface Context { foo: Foo; } } } I made sure that the augmentations.d.ts file is part of a glob pattern in the include