Skip to main content

getSourceOfMock

getSourceOfMock returns the origin of a mock class.

// returns the source class of `MockClass`
const OriginalClass1 = getSourceOfMock(MockClass);

// returns the same class if OriginalClass2 is not a mock
const OriginalClass2 = getSourceOfMock(OriginalClass2);