Make compatible with Jest
This is some great stuff! However we have recently migrated from Karma to Jest and Jest does not expose the createSpyObj method of Jasmine. As such, I've had to "copy" over the mocks you have that I want to use and have them use this version of `createSpyObj'. If you could incorporate it somehow into your code, that would be great!!
export function createSpyObj (baseName: string, methodNames: string[]): { [key: string]: jasmine.Spy } {
const obj: any = {}
for (let i: number = 0; i < methodNames.length; i++) {
obj[methodNames[i]] = jasmine.createSpy(baseName, () => {})
}
return obj
}
@russcarver thanks for the issue. I've never used Jest but I'll have a look.
+1 on this, Id love to use your mocks but using jest is painful with it.
@russcarver @MagicAardvark do either of you have a public project that is using jest that I could clone and tinker with?
I do not currently, Jest is very very simple to set up. as a temporary fix I can offer a 'fix' I made to your code to use @russcarver's suggestion above. ill open a PR for you.
@MagicAardvark, thank you.
https://github.com/stonelasley/ionic-mocks/pull/31