Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

TypeScript: @types/jasmine clash with @types/mocha #3880

Closed
jan-molak opened this issue Dec 26, 2016 · 2 comments
Closed

TypeScript: @types/jasmine clash with @types/mocha #3880

jan-molak opened this issue Dec 26, 2016 · 2 comments

Comments

@jan-molak
Copy link
Contributor

Hello!

Protractor supports both Jasmine and Mocha, but because the library defines a dependency on @types/jasmine, having a dependency on @types/mocha in a typescript project utilising both protractor and mocha causes the typescript compiler to complain about duplicate global identifiers as both mocha and jasmine fight for the global space:

node_modules/@types/jasmine/index.d.ts(9,18): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/jasmine/index.d.ts(11,18): error TS2300: Duplicate identifier 'xdescribe'.
node_modules/@types/jasmine/index.d.ts(13,18): error TS2300: Duplicate identifier 'it'.
node_modules/@types/jasmine/index.d.ts(15,18): error TS2300: Duplicate identifier 'xit'.
node_modules/@types/mocha/index.d.ts(33,13): error TS2300: Duplicate identifier 'describe'.
node_modules/@types/mocha/index.d.ts(34,13): error TS2300: Duplicate identifier 'xdescribe'.
node_modules/@types/mocha/index.d.ts(39,13): error TS2300: Duplicate identifier 'it'.
node_modules/@types/mocha/index.d.ts(40,13): error TS2300: Duplicate identifier 'xit'.

Since not all projects using protractor use jasmine, perhaps you'd like to consider making the dependency on @types/jasmine optional?

Many thanks,
Jan

node: 6.5.0
npm: 3.10.3
protractor: 4.0.14
@cnishina
Copy link
Member

This has been fixed with #3795.

Set the compiler options array in your tsconfig for now with mocha per #3792.

@jan-molak
Copy link
Contributor Author

Cool, cheers @cnishina. Looking forward to the next release!

J

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants