Skip to main content

isMockedNgDefOf

isMockedNgDefOf helps when we need to verify that a class is actually a mock class.

// checks whether `MockClass` is// a mock class of `SomeClass` and a moduleif (isMockedNgDefOf(MockClass, SomeClass, 'm')) {  // yes, it is}
// checks whether `MockClass` is// a mock class of `SomeClass` and a componentif (isMockedNgDefOf(MockClass, SomeClass, 'c')) {  // yes, it is}
// checks whether `MockClass` is// a mock class of `SomeClass` and a directiveif (isMockedNgDefOf(MockClass, SomeClass, 'd')) {  // yes, it is}
// checks whether `MockClass` is// a mock class of `SomeClass` and a pipeif (isMockedNgDefOf(MockClass, SomeClass, 'p')) {  // yes, it is}
// checks whether `MockClass` is// a mock class of `SomeClass`if (isMockedNgDefOf(MockClass, SomeClass)) {  // yes, it is}