ValentinH / jest-fail-on-console

Utility to make jest tests fail when console.error() or any other methods are used
MIT License
141 stars 20 forks source link

Type errors in `index.d.ts` #27

Closed blordpluto closed 1 year ago

blordpluto commented 1 year ago

There are typecheck errors in index.d.ts file in the 3.0.0 release:

node_modules/jest-fail-on-console/index.d.ts:45:29 - error TS2300: Duplicate identifier 'string'.

45     skipTest?: ({ testName: string, testPath: string }) => boolean
                               ~~~~~~

node_modules/jest-fail-on-console/index.d.ts:45:29 - error TS7031: Binding element 'string' implicitly has an 'any' type.

45     skipTest?: ({ testName: string, testPath: string }) => boolean
                               ~~~~~~

node_modules/jest-fail-on-console/index.d.ts:45:47 - error TS2300: Duplicate identifier 'string'.

45     skipTest?: ({ testName: string, testPath: string }) => boolean
                                                 ~~~~~~

node_modules/jest-fail-on-console/index.d.ts:45:47 - error TS7031: Binding element 'string' implicitly has an 'any' type.

45     skipTest?: ({ testName: string, testPath: string }) => boolean

I am also going to just mention that these are the same type of syntax errors that were pointed out and fixed in https://github.com/ValentinH/jest-fail-on-console/issues/22

Maybe there are automated tools you could use to catch this sort of thing? 😄

ValentinH commented 1 year ago

Thanks for the report. Do you have any tools name to share that could detect these issues? Maybe directly tsc?

blordpluto commented 1 year ago

Yeah I think a good old tsc --noEmit would probably work.

ValentinH commented 1 year ago

Alright, ill fix this tomorrow when I'm on a computer

ValentinH commented 1 year ago

Fixed in https://github.com/ValentinH/jest-fail-on-console/releases/tag/v3.0.1 I also added a typecheck step as suggested 👍