Skip to content

Network testing: linter and prettier fixes#1001

Merged
mnaamani merged 18 commits intoJoystream:nicaeafrom
gleb-urvanov:feature/linter
Jul 23, 2020
Merged

Network testing: linter and prettier fixes#1001
mnaamani merged 18 commits intoJoystream:nicaeafrom
gleb-urvanov:feature/linter

Conversation

@gleb-urvanov
Copy link
Contributor

Linter and prettier rules applied to the network tests codebase.
Also refactoring from #952

@mnaamani
Copy link
Member

Needs another merge from nicaea to resolve the conflict in yarn.lock probably related to this: #988 (comment)

@mnaamani
Copy link
Member

Looks good, I'm testing by running the npm scripts, lint, format and checks

lint is working great.
format is trying to change files in .nyc_output so you probbaly want to add a .prettierignore file to ignore that folder.

Part of the checks script does: tsc --noEmit --pretty and its spitting out these errors. Is it something we can fix in by tweaking tsconfig.json ?

yarn run v1.22.4
$ /Users/mokhtar/joystream/joystream/node_modules/.bin/tsc --noEmit --pretty
../../node_modules/@types/mocha/index.d.ts:2734:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'Lifecycle', but here has type 'HookFunction'.

2734 declare var beforeEach: Mocha.HookFunction;
                 ~~~~~~~~~~

  ../../node_modules/@types/jest/index.d.ts:34:13
    34 declare var beforeEach: jest.Lifecycle;
                   ~~~~~~~~~~
    'beforeEach' was also declared here.

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

2752 declare var afterEach: Mocha.HookFunction;
                 ~~~~~~~~~

  ../../node_modules/@types/jest/index.d.ts:36:13
    36 declare var afterEach: jest.Lifecycle;
                   ~~~~~~~~~
    'afterEach' was also declared here.

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

2768 declare var describe: Mocha.SuiteFunction;
                 ~~~~~~~~

  ../../node_modules/@types/jest/index.d.ts:37:13
    37 declare var describe: jest.Describe;
                   ~~~~~~~~
    'describe' was also declared here.

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

2789 declare var xdescribe: Mocha.PendingSuiteFunction;
                 ~~~~~~~~~

  ../../node_modules/@types/jest/index.d.ts:39:13
    39 declare var xdescribe: jest.Describe;
                   ~~~~~~~~~
    'xdescribe' was also declared here.

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

2803 declare var it: Mocha.TestFunction;
                 ~~

  ../../node_modules/@types/jest/index.d.ts:40:13
    40 declare var it: jest.It;
                   ~~
    'it' was also declared here.

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

2817 declare var test: Mocha.TestFunction;
                 ~~~~

  ../../node_modules/@types/jest/index.d.ts:43:13
    43 declare var test: jest.It;
                   ~~~~
    'test' was also declared here.

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

2824 declare var xit: Mocha.PendingTestFunction;
                 ~~~

  ../../node_modules/@types/jest/index.d.ts:42:13
    42 declare var xit: jest.It;
                   ~~~
    'xit' was also declared here.


Found 7 errors.

error Command failed with exit code 1.

@mnaamani
Copy link
Member

Happy to report tests ran through smoothly to the end 👍

@mnaamani mnaamani marked this pull request as ready for review July 22, 2020 21:36
@mnaamani
Copy link
Member

After merging #1027 this now has merge conflicts

@mnaamani mnaamani merged commit 1491ef8 into Joystream:nicaea Jul 23, 2020
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

Successfully merging this pull request may close these issues.

2 participants