mocha-steps icon indicating copy to clipboard operation
mocha-steps copied to clipboard

Namespace 'Mocha' has no exported member 'Func'.

Open Esqarrouth opened this issue 5 years ago • 6 comments

node_modules/mocha-steps/lib/mocha-steps.d.ts(3,45): error TS2694: Namespace 'Mocha' has no exported member 'Func'.
node_modules/mocha-steps/lib/mocha-steps.d.ts(3,72): error TS2694: Namespace 'Mocha' has no exported member 'Test'.
node_modules/mocha-steps/lib/mocha-steps.d.ts(4,46): error TS2694: Namespace 'Mocha' has no exported member 'Func'.
node_modules/mocha-steps/lib/mocha-steps.d.ts(4,73): error TS2694: Namespace 'Mocha' has no exported member 'Test'.

This shows while compiling Typescript,

http://prntscr.com/nb4yan

Esqarrouth avatar Apr 12 '19 17:04 Esqarrouth

Any ideas?

Esqarrouth avatar Jun 04 '19 17:06 Esqarrouth

Still happening

Esqarrouth avatar Apr 15 '20 13:04 Esqarrouth

@rprieto @mrhornsby @tandrup

Esqarrouth avatar Apr 15 '20 13:04 Esqarrouth

Hi @goktugyil - have you got @types/Mocha as a devDependency for your project? Func is defined in there https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mocha/index.d.ts#L2219

mrhornsby avatar Apr 15 '20 15:04 mrhornsby

Hi @goktugyil - have you got @types/Mocha as a devDependency for your project? Func is defined in there https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/mocha/index.d.ts#L2219

@mrhornsby I try get that, both 1.1.2 and 1.3.0, however it did not solve this error

Esqarrouth avatar Apr 16 '20 12:04 Esqarrouth

Hi @goktugyil - I've just checked one of my projects and it is compiling fine and tests are passing. Here are all the versions that might be relevant from my package.json:

    "@types/mocha": "7.0.2",
    "mocha": "7.1.1",
    "mocha-steps": "1.3.0",
    "typescript": "3.5.2",

In my IDE clicking on the Func symbol in mocha-steps takes me through to @types/mocha so I'm sure it is correctly resolving to the type.

The only additional thing might be something in your tsconfig.json - I've copied a slightly redacted version of mine below to see if that gives you a clue:

{
  "compilerOptions": {
    "allowJs": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "build",
    "strict": true,
    "target": "es2017",
    "typeRoots": ["node_modules/@types"]
  },
  "include": ["src/ts/**/*.ts"]
}

Hope this helps to solve your issue as I can't really see what it would be beyond that.

Regards

Mark

mrhornsby avatar Apr 16 '20 13:04 mrhornsby