adding mochawesome reporter in typescript

486 Views Asked by At

I am trying to add MochaAwesome reporter in my cypress typescript tests. When I add require('cypress-mochawesome-reporter/plugin')(on); in my cypress.config.ts file, I am getting "Require statement not part of import statement". Have anyone else seen this issue and is there any solution for this problem? enter image description here

1

There are 1 best solutions below

0
Zokki On

Maybe the 'tsconfig.json'?

My config looks something like

{
    "compilerOptions": {
        "strict": true,
        "baseUrl": ".",
        "target": "ES2019",
        "lib": ["ESNext", "DOM"],
        "types": ["cypress", "node"],
        "module": "ESNext",
        "moduleResolution": "Node",
        "resolveJsonModule": true,
        "allowSyntheticDefaultImports": true
    },
    "include": ["**/*.ts", "cypress/**/*.ts"]
}