While this question shares similarities with another one found at this link, the key difference here is that typescript is being used.
The issue at hand involves retrieving the current test title from within a mocha test, but due to the usage of typescript, the following code fails:
import 'mocha';
describe("top", () => {
console.log(this.title);
console.log(this.fullTitle());
it("test", () => {
console.log(this.test.title);
console.log(this.test.fullTitle());
});
});
With typescript involved, accessing this
becomes obscured and direct access to native JavaScript's this
is no longer viable.
Have you encountered this problem before? Is there any workaround available for it?