mochawesome
mochawesome copied to clipboard
Getting an error while adding addContext in my test file
Hi there,
I am adding addContext in my testfile but getting following error:
Could not find a declaration file for module 'mochawesome/addContext'. 'd:/Cypress/CypressProject/node_modules/mochawesome/addContext.js' implicitly has an 'any' type. Try npm install @types/mochawesome if it exists or add a new declaration (.d.ts) file containing `declare module 'mochawesome/addContext';
I wrote this line of code where I am getting above error const addContext = require('mochawesome/addContext')
Somebody can help please?
Hey @HamzaQA, I'm guessing you got this figured out, but the root cause is that there is no package in the DefinitelyTyped
repository. I have just submitted a PR to add those types and will reply again here (or edit this comment) when it has been approved.
Once they are approved, you will be able to get the declaration file by installing @types/mochawesome
as a dev dependency.