Answer the question
In order to leave comments, you need to log in
How to extend mocha context in typescript?
Hello. Actually, I have global hooks that create a piece of data and write it to this . Naturally, these variables remain untyped in my tests. I would like to fix this by extending the Context with d.ts
What I tried:
declare namespace Mocha {
class Context {
client: IClient;
bus: IBus;
testNumber: number;
connectionParams: ConnectionParams;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question