Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings are incompatible with jest #16

Open
mdnorman opened this issue Mar 1, 2020 · 1 comment
Open

Typings are incompatible with jest #16

mdnorman opened this issue Mar 1, 2020 · 1 comment

Comments

@mdnorman
Copy link

mdnorman commented Mar 1, 2020

Because truffle-typings includes chai and mocha constants, the same project can't use jest for tests.

Build errors:

node_modules/@types/jest/index.d.ts:33:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

33 declare var beforeEach: jest.Lifecycle;
               ~~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2680:13
    2680 declare var beforeEach: Mocha.HookFunction;
                     ~~~~~~~~~~
    'beforeEach' was also declared here.

node_modules/@types/jest/index.d.ts:35:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

35 declare var afterEach: jest.Lifecycle;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2698:13
    2698 declare var afterEach: Mocha.HookFunction;
                     ~~~~~~~~~
    'afterEach' was also declared here.

node_modules/@types/jest/index.d.ts:36:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'SuiteFunction', but here has type 'Describe'.

36 declare var describe: jest.Describe;
               ~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2714:13
    2714 declare var describe: Mocha.SuiteFunction;
                     ~~~~~~~~
    'describe' was also declared here.

node_modules/@types/jest/index.d.ts:38:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'PendingSuiteFunction', but here has type 'Describe'.

38 declare var xdescribe: jest.Describe;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2735:13
    2735 declare var xdescribe: Mocha.PendingSuiteFunction;
                     ~~~~~~~~~
    'xdescribe' was also declared here.

node_modules/@types/jest/index.d.ts:39:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'it' must be of type 'TestFunction', but here has type 'It'.

39 declare var it: jest.It;
               ~~

  node_modules/@types/mocha/index.d.ts:2749:13
    2749 declare var it: Mocha.TestFunction;
                     ~~
    'it' was also declared here.

node_modules/@types/jest/index.d.ts:41:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xit' must be of type 'PendingTestFunction', but here has type 'It'.

41 declare var xit: jest.It;
               ~~~

  node_modules/@types/mocha/index.d.ts:2770:13
    2770 declare var xit: Mocha.PendingTestFunction;
                     ~~~
    'xit' was also declared here.

node_modules/@types/jest/index.d.ts:42:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'TestFunction', but here has type 'It'.

42 declare var test: jest.It;
               ~~~~

  node_modules/@types/mocha/index.d.ts:2763:13
    2763 declare var test: Mocha.TestFunction;
                     ~~~~
    'test' was also declared here.

node_modules/@types/jest/index.d.ts:45:15 - error TS2451: Cannot redeclare block-scoped variable 'expect'.

45 declare const expect: jest.Expect;
                 ~~~~~~

  node_modules/truffle-typings/index.d.ts:11:15
    11 declare const expect: Chai.ExpectStatic;
                     ~~~~~~
    'expect' was also declared here.

node_modules/truffle-typings/index.d.ts:11:15 - error TS2451: Cannot redeclare block-scoped variable 'expect'.

11 declare const expect: Chai.ExpectStatic;
                 ~~~~~~

  node_modules/@types/jest/index.d.ts:45:15
    45 declare const expect: jest.Expect;
                     ~~~~~~
    'expect' was also declared here.
@guruprasath605
Copy link

is it done..

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

No branches or pull requests

2 participants