When using jest 23.x the package resolver (yarn in my case) will show warning " > [email protected]" has incorrect peer dependency "jest@^22.0.0".
I can still use that new version, I'm unsure if there are any breaking changes or whether we can just loosen those restrictions.
There were couple of breaking changes in 23, but not affecting this preset too much AFACT. We're waiting for ts-jest to upgrade to 23 though.
@thymikee ts-jest has been updated to support jest 23: https://github.com/kulshekhar/ts-jest/commit/52145c71b43b44d5bc05c72fe296d2ee6909a2fc
@JLHwung unfortunately they haven't released their master branch yet.
Waiting for this one for my schematics (https://github.com/davinkevin/jest) allowing simple configuration of jest inside of an Angular CLI project with the help of this project
I tried to update to jest 23 and I've got an error TypeError Event is not a constructor and indeed global Event is null ? Is it in the couple of breaking changes ? I can't find anything related in Jest Changelog ?
Hi,
Unfortunately we aren't sure about supporting Jest 23 fully because we have a dependency on ts-jest. ts-jest hasn't updated to support Jest 23 yet so we can't test your case now.
Thanks @ahnpnl, I found a workaround anyway. I'll keep that in mind for when everything will be ok. Thanks again for the great job on that preset !
@paulsouche could you share your solution? We ran into the same issue.
@blackholegalaxy Event mock polyfill
class Event {
preventDefault = jest.fn();
stopPropagation = jest.fn();
constructor(meta: any = {}) {
Object.assign(this, meta);
}
}
// in your config
global.Event = Event;
ts-jest has been released in version 23.0.0 :)
Thanks @squelix, already fixed by: https://github.com/thymikee/jest-preset-angular/pull/166
Just published next tag being v6.0.0-rc.0, feel free to give it a try and later this week I'll release v6 ;)
Thanks @thymikee
Most helpful comment
Just published
nexttag being v6.0.0-rc.0, feel free to give it a try and later this week I'll release v6 ;)