Ts-jest: Disable message about diagnostics

Created on 23 Mar 2020  路  7Comments  路  Source: kulshekhar/ts-jest

So when the diagnostics hits an error, it will write something like this;

Test suite failed to run

TypeScript diagnostics (customize using `[jest-config].globals.ts-jest.diagnostics` option):
<file> - error <message>`

Now I might be alone in this but I do appreciate the error, but I don't want to see that " TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics option)" line.

Is there any way to disable it? With lots of errors it keeps repeating and distracts from the actual errors. I also think its pretty useless to display on each error and would rather like to see it once at the end or something. But if I could remove the message entirely from the log, that would work better on environments that I would want logging on to see what error I got.

Enhancement

All 7 comments

you can鈥檛 disable but you can do other things to it: either you can set to warning level or filter on the diagnostic error to display. You can read about it more in documentation.

By default, ts-jest throws error to cancel tests based on diagnostic information. Diagnostic error comes from type checking. Perhaps a feature request to disable diagnostics logging is possible.

Now I might be alone in this but I do appreciate the error, but I don't want to see that " TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics option)" line.

sorry I missed this part. Yes we can remove it. It doesn't look so user friendly indeed

hmm, just to confirm: you don't want to see the whole text:

" TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics option)"

or you don't want to see

"(customize using [jest-config].globals.ts-jest.diagnostics option)"

if changing this message, it will be a breaking change for all users. Not sure if we want that.
cc @kulshekhar

I think the whole line is not needed. I think its pretty obvious its a typescript error? But if one is a breaking change and the other isn't, then I'm fine with either. For me its most important to have a clear focus on the errors and all the diagnostics option stuff is in the way of short errors.

For me it is obviously type error. Actually changing the text in any ways is a breaking change. However, this breaking change is not so serious since it might only affect to users who use snapshot or comparing against hardcoded string. If @kulshekhar is ok with it, we can do.

I'm alright with this change. If this is being repeated every time and impedes reading the actual error details then it might be best to remove it

" TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics option)"

Ok let鈥檚 remove this part then 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RiJung picture RiJung  路  4Comments

stephenotalora picture stephenotalora  路  3Comments

ozum picture ozum  路  4Comments

artola picture artola  路  3Comments

bySabi picture bySabi  路  4Comments